Weaver

  • Workflow Execution Management Service (EMS)

  • Application, Deployment and Execution Service (ADES)

Weaver (the nest-builder)

Weaver birds build exquisite and elaborate nest structures that are a rival to any human feat of engineering. Some of these nests are the largest structures to be built by birds. (Eden).

Although weavers are named for their elaborately woven nests, some are notable for their selective parasitic nesting habits instead. (Wikipedia)

Weaver is an Execution Management Service (EMS) that allows the execution of workflows chaining various applications and Web Processing Services (WPS) inputs and outputs. Remote execution is deferred by the EMS to an Application Deployment and Execution Service (ADES), as defined by Common Workflow Language (CWL) configurations.

Weaver can be launched either as an EMS or an ADES according to configuration values it is deployed with. For more details, see Configuration section.

dependencies

Requires Python 3.6+ Requirements Status Dependencies Status

build status

ReadTheDocs Build Status (master branch) Docker Build Mode (latest version) Docker Build Status (latest version)

tests status

Github Actions CI Build Status (master branch) Github Actions CI Build Status (latest tag) Code Coverage Codacy Badge

releases

Latest Tagged Version Commits since latest release GitHub License

Summary

Weaver is primarily an Execution Management Service (EMS) that allows the execution of workflows chaining various applications and Web Processing Services (WPS) inputs and outputs. Remote execution of each process in a workflow chain is dispatched by the EMS to one or many registered Application Deployment and Execution Service (ADES) by ensuring the transfer of files accordingly between instances when located across multiple remote locations.

Weaver can also accomplish the ADES role in order to perform application deployment at the data source using the application definition provided by Common Workflow Language (CWL) configuration. It can then directly execute a registered process execution with received inputs from a WPS request to expose output results for a following ADES in a EMS workflow execution chain.

Weaver extends the OGC API - Processes (WPS-REST bindings) by providing additional functionalities such as more detailed job log routes, adding more process management request options than required by the standard, and supporting remote providers to name a few. Because of this, not all features offered in Weaver are guaranteed to be applicable on other similarly behaving ADES and/or EMS instances. The reference specification is tracked to preserve the minimal conformance requirements and provide feedback to Open Geospatial Consortium (OGC) in this effect.

Weaver can be launched either as an EMS or an ADES according to configuration values it is deployed with. For more details, see Configuration and Documentation sections.

Configuration

All configuration settings can be overridden using a weaver.ini file that will be picked during instantiation of the application. An example of such file is provided here: weaver.ini.example.

Setting Weaver’s operational mode (EMS/ADES) is accomplished using the weaver.configuration field of weaver.ini.

For more configuration details, please refer to Documentation.

Documentation

The REST API documentation is auto-generated and served under any running Weaver application on route {WEAVER_URL}/api/. This documentation will correspond to the version of the executed Weaver application. For the latest documentation, you can refer to the OpenAPI Specification served directly on ReadTheDocs.

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

Extra Details & Sponsors

The project was initially developed upon OGC Testbed-14 – ESA Sponsored Threads – Exploitation Platform findings and following improvements. It is also advanced with sponsorship of U.S. Department of Energy to support common API of the Earth System Grid Federation (ESGF). The findings are reported on the OGC Testbed-14 thread, and more explicitly in the ADES & EMS Results and Best Practices Engineering Report.

The project has been employed for OGC Testbed-15 - ML Thread to demonstrate the use of Machine Learning interactions with OGC web standards in the context of natural resources applications. The advancements are reported through the OGC Testbed-15: Machine Learning Engineering Report.

Developments are continued in OGC Testbed-16 to improve methodologies in order to provide better interoperable geospatial data processing in the areas of Earth Observation Application Packages.

The project is furthermore developed through the Data Analytics for Canadian Climate Services (DACCS) initiative.

Weaver is a prototype implemented in Python with the Pyramid web framework. It is part of PAVICS and Birdhouse ecosystems.

Table of Contents

Installation

The installation is using the Python distribution system Miniconda (default installation of no conda found) to maintain software dependencies. Any conda installation should work the same. To use a pre-installed conda distribution, simply make sure that it can be found on the shell path.

Requirements

The installation works on Linux 64 bit distributions (tested on Ubuntu 16.04).

Note

Windows is not officially supported, but some patches have been applied to help using it. If you find some problems, please submit a new issue or open a pull request with fixes.

From GitHub Sources

Install weaver as normal user from GitHub sources:

git clone https://github.com/crim-ca/weaver.git
cd weaver
make install

If no conda environment is activated, the install process will setup a new or reuse the conda environment named weaver and install all dependency packages. If an environment is activated, Weaver will be installed in that environment. You can also enforce a specific environment using:

make CONDA_ENV=<my-env> install

Windows Installation

Minimal support is provided to run the code on Windows. To do so, the Makefile assumes you are running in a MINGW environment, that conda is already installed, and that it is available from CONDA_HOME variable or similar. If this is not the case, you will have to adjust the reference variables accordingly.

Note

Windows support is not official and any dependency could stop supporting it at any given time. Particularly, libraries for Celery task execution have a tendency to break between versions for Windows. The application is regularly evaluated on a Linux virtual machine. It is recommended to run it as so or using the existing Docker images.

Known issues
  • Package shapely.geos has C++ dependency to geos library. If the package was installed in a conda environment, but through pip install call, the source path will not be found. You have to make sure to install it using conda install -c conda-forge shapely.

  • The example weaver.ini.example file uses gunicorn by default to take advantage of its performance features, but this package does not support Windows. Alternatively, you might need to use waitress by replacing it in the [server:main] section.

Please refer to Configuration and Running sections for following steps.

Configuration

After you have installed Weaver, you can customize its behaviour using multiple configuration settings.

Configuration Settings

All settings are configured using a weaver.ini configuration file. A weaver.ini.example file is provided with default values to help in the configuration process. Explanations of respective settings are also available in this example file.

The configuration file tell the application runner (e.g. Gunicorn, pserve or similar WSGI HTTP Server), how to execute Weaver as well as all settings to provide in order to personalize the application. All settings specific to Weaver employ the format weaver.<setting>.

Most configuration parameters for the manager portion of Weaver (i.e.: WSGI HTTP server for API endpoints) are defined in the [app:main] section of weaver.ini.example, while parameters specific to the worker (task queue handler) are within [celery] section. Note that multiple settings are shared between the two applications, such as the mongodb.[...] configuration or weaver.configuration options. When parameters are shared, they are usually expected to be placed in [app:main] section.

Following is a partial list of most predominant settings specific to Weaver. Many parameters provide alternative or extended functionality when employed in conjunction with other settings. Others are sometimes not necessarily required to be defined if default behaviour is desired. Refer to the relevant details that will describe in which condition they are optional and which default value or operation is applied in each situation.

Note

Refer to weaver.ini.example for the extended list of applicable settings. Some advanced configuration settings are also described in other sections of this page.

  • weaver.configuration = ADES|EMS|HYBRID|DEFAULT
    (default: DEFAULT)

    Tells the application in which mode to run.

    Enabling ADES for instance will disable some EMS-specific operations such as dispatching Workflow process steps to known remote ADES servers. ADES should be used to only run processes locally (as the working unit). EMS will always dispatch execution of jobs to other ADES except for Workflow processes that chains them.
    When HYBRID is specified, Weaver will assume both ADES and EMS roles simultaneously, meaning it will be able to execute local processes by itself and monitor dispatched execution of registered remote providers.
    Finally, DEFAULT configuration will provide very minimalistic operations as all other modes will be unavailable.
  • weaver.url = <url>
    (default: https://localhost)

    Defines the full URL (including HTTP protocol/scheme, hostname and optionally additional path suffix) that will be used as base URL for all other URL settings of Weaver.

Note

This is the URL that you want displayed in responses (e.g.: processDescriptionURL or job location). For the effective URL employed by the WSGI HTTP server, refer to [server:main] section of weaver.ini.example.

  • weaver.wps = true|false
    (default: true)

    Enables the WPS-1/2 endpoint.

Warning

At the moment, this setting must be true to allow job execution as the worker monitors this endpoint. This could change with future developments (see issue #21).

  • weaver.wps_path = <url-path>
    weaver.wps_url = <full-url>
    (default: path /ows/wps)

    Defines the URL to employ as WPS-1/2 endpoint.

    It can either be the explicit full URL to use or the path relative to weaver.url.
    Setting weaver.wps_path is ignored if its URL equivalent is defined.
    The path variant SHOULD start with / for appropriate concatenation with weaver.url, although this is not strictly enforced.
  • weaver.wps_output_s3_bucket = <s3-bucket>
    (default: None)

    AWS S3 bucket where to store WPS outputs. Used in conjunction with weaver.wps_output_s3_region.

    When this parameter is defined, any job result generated by a process execution will be stored (uploaded) to that location. If no bucket is specified, the outputs fall back to using the location specified by weaver.wps_output_dir.

New in version 1.13.0.

  • weaver.wps_output_s3_region = <s3-region>
    (default: None)

    AWS S3 region to employ for storing WPS outputs. Used in conjunction with weaver.wps_output_s3_bucket.

    When this parameter is defined as well as weaver.wps_output_s3_bucket, it is employed to define which S3 to write output files to. If not defined but weaver.wps_output_s3_bucket is specified, Weaver attempt to retrieve the region from the profile defined in AWS configuration files or environment variables.

New in version 1.13.0.

  • weaver.wps_output_dir = <directory-path>
    (default: /tmp)

    Location where WPS outputs (results from jobs) will be stored for stage-out.

    When weaver.wps_output_s3_bucket is specified, only WPS XML status and log files are stored under this path. Otherwise, job results are also located under this directory with a sub-directory named with the job ID.
    This directory should be mapped to Weaver’s WPS output URL to serve them externally as needed.
  • weaver.wps_output_path = <url-path>
    weaver.wps_output_url = <full-url>
    (default: path /wpsoutputs)

    Endpoint that will be employed as prefix to refer to WPS outputs (job results).

    It can either be the explicit full URL to use or the path relative to weaver.url.
    Setting weaver.wps_output_path is ignored if its URL equivalent is defined.
    The path variant SHOULD start with / for appropriate concatenation with weaver.url, although this is not strictly enforced.
  • weaver.wps_workdir = <directory-path>
    (default: uses automatically generated temporary directory if none specified)

    Prefix where process job worker should execute the process from.
  • weaver.wps_restapi = true|false
    (default: true)

    Enable the WPS-REST endpoint.

Warning

Weaver looses most, if not all, of its useful features without this, and there won’t be much point in using it without REST endpoint, but it should technically be possible to run it as WPS-1/2 only if desired.

  • weaver.wps_restapi_path = <url-path>
    weaver.wps_restapi_url = <full-url>
    (default: path /)

    Endpoint that will be employed as prefix to refer to WPS-REST requests
    (including but not limited to OGC API - Processes schemas).

    It can either be the explicit full URL to use or the path relative to weaver.url.
    Setting weaver.wps_restapi_path is ignored if its URL equivalent is defined.
    The path variant SHOULD start with / for appropriate concatenation with weaver.url, although this is not strictly enforced.
  • weaver.wps_metadata_[...] (multiple settings)

    Metadata fields that will be rendered by either or both the WPS-1/2 and WPS-REST endpoints (Access registered process(es) (GetCapabilities, DescribeProcess)).
  • weaver.wps_email_[...] (multiple settings)

    Defines configuration of email notification functionality on job completion.

    Encryption settings as well as custom email templates are available. Default email template defined in email-template is employed if none is provided. Email notifications are sent only on job completion if an email was provided in the Execution of a process (Execute) request body (see also: Email Notification).

Note

Since Weaver employs Celery as task queue manager and MongoDB as backend, relevant settings for the configuration of Celery and the configuration of MongoDB Backend should be referred to. Processing of task jobs and results reporting is accomplished according to the specific implementation of these services. Therefore, all applicable settings and extensions should be available for custom server configuration and scaling as needed.

Configuration of AWS S3 Buckets

Any AWS S3 bucket accessed by Weaver needs to be accessible by the application, whether it is to fetch input files or to store output results. This can require from the server administrator to specify credentials by one of reference supported methodologies to provide necessary role and/or permissions. See also reference AWS Configuration which list various options that will be considered when working with S3 buckets.

Note that Weaver expects the AWS Configuration to define a default profile from which the AWS client can infer which region it needs to connect to. The S3 bucket to store files should be defined by weaver.wps_output_s3_bucket setting as presented in the previous section.

The S3 file references for input and output in Weaver are expected to be formatted as:

s3://<bucket>/<file-key>

This implicitly tells Weaver to employ the S3 bucket it was configured with as well as the automatically retrieved region from the AWS server configuration.

Alternatively, the reference can be provided with the more explicit AWS S3 link such as:

https://s3.[region-name.]amazonaws.com/<bucket>/<file-key>

In this situation, Weaver will parse it as equivalent to the prior shorthand reference format, as long as the AWS server configuration matches with all associated details from the HTTP URL variant. If this is not the case, Weaver will still attempt to fetch the file as standard HTTP reference, but read access should be granted accordingly to the corresponding bucket and file such that Weaver can access it.

Finally, in the above references, file-key is used as anything after the bucket name. In other words, this value can contain any amount of / separators and details. For example, Weaver will store process output results to S3 using file-key as a combination of <WPS-UUID>/<output-id>.<ext>, therefore forming the full job result file references as:

https://s3.<region-name>.amazonaws.com/<bucket>/<WPS-UUID>/<output-id>.<ext>

Note

Value of WPS-UUID can be retrieved from Weaver internal job storage from weaver.datatypes.Job.wps_id(). It refers to the process execution identifier that accomplished the WPS request to run the Application Package.

Configuration of WPS Processes

Weaver allows the configuration of services or processes auto-deployment using definitions from a file formatted as wps_processes.yml.example. On application startup, provided references in processes list will be employed to attempt deployment of corresponding processes locally. Given that the resources can be correctly resolved, they will immediately be available from Weaver’s API without further request needed.

For convenience, every reference URL in the configuration file can either refer to explicit process definition (i.e.: endpoint and query parameters that resolve to Access registered process(es) (GetCapabilities, DescribeProcess) response), or a group of processes under a common WPS server to iteratively register, using a Access registered process(es) (GetCapabilities, DescribeProcess) WPS endpoint. Please refer to wps_processes.yml.example for explicit format, keywords supported, and their resulting behaviour.

Note

Processes defined under processes section registered into Weaver will correspond to a local snapshot of the remote resource at that point in time, and will not update if the reference changes. On the other hand, their listing and description offering will not require the remote service to be available at all time until execution.

New in version 1.14.0: When references are specified using providers section instead of processes, the registration only saves the remote WPS provider endpoint to dynamically populate WPS processes on demand.

Using this registration method, the processes will always reflect the latest modification from the remote WPS provider.

To specify a custom YAML file, you can define the setting named weaver.wps_processes_file with the appropriate path within the employed weaver.ini file that starts your application. By default, this setting will look for the provided path as absolute location, then will attempt to resolve relative path (corresponding to where the application is started from), and will also look within the weaver/config directory. If none of the files can be found, the operation is skipped.

To ensure that this feature is disabled and to avoid any unexpected auto-deployment provided by this functionality, simply set setting weaver.wps_processes_file as undefined (i.e.: nothing after = in weaver.ini).

Configuration of Request Options

Todo

complete docs

weaver.ssl_verify

New in version 1.8.0.

request_options.yml.example

Starting the Application

Todo

complete docs

make start (or similar command)

Running Weaver

Running Weaver Service

Before running Weaver, you must make sure that the required MongoDB connection is accessible according to specified connection settings in weaver/config/weaver.ini.

Weaver installation comes with a Makefile which provides a shortcut command to start the application with Gunicorn:

Note

If using Windows, make sure you have read the Windows Installation section.

$ make start    # start Weaver WSGI application server

Weaver should be running after this operation. It will be available under the configured URL endpoint in weaver.ini (see weaver.ini.example). If everything was configured correctly, calling this URL (default: http://localhost:4001) should provide a response containing a JSON body with basic information about Weaver.

Execution Details

To execute, Weaver requires two type of application executed in parallel. First, it requires a WSGI HTTP server that will run the application to provide API endpoints. This is referred to as weaver-manager in the provided docker images. Second, Weaver requires a Celery task queue handler to execute submitted process jobs. This is referred to as weaver-worker in built Docker images.

For specific details about configuration of both applications, please refer to Configuration section.

The typical commands that need to be executed for the manager and worker applications should be similar to the following calls. Obviously, additional arguments supported by the corresponding applications can be provided.

# manager
pserve <weaver-root>/config/weaver.ini

# worker
celery worker -A pyramid_celery.celery_app --ini <weaver-root>/config/weaver.ini

Tutorial

Using the WPS application included in Weaver

Install Weaver (see: Installation) and make sure all required components are started and running (see: Configuration).

Then, execute the desired WPS or WPS-REST request according to desired operation mode and version.

For all following examples, ${WEAVER_URL} is used to specify your application URL endpoint configuration. By default, this value should be localhost:4001.

Note

This tutorial section is a minimal introduction to available requests and endpoints. Please refer to processes for further details, such as detailed request payload contents, types of processes and additional operations that compose a typical process execution workflow. Similarly, refer to Application Package for further details about the definition of the reference application executed by the deployed processes.

WPS-1/2 requests

Specifying the appropriate version=<1.0.0|2.0.0> parameter in the URL as required.

Run a WPS-1/WPS-2 GetCapabilities request:

$ curl -k "${WEAVER_URL}/ows/wps?service=wps&request=getcapabilities"

You should receive an XML response listing service details and available processes.

Run a WPS-1/WPS-2 DescribeProcess request (built-in process jsonarray2netcdf):

$ curl -k "${WEAVER_URL}/ows/wps?service=wps&request=describeprocess&identifier=jsonarray2netcdf&version=1.0.0"

This will provide you with an XML response listing the specific process details such and inputs/outputs and description.

We can now use the process to execute a WPS request. To do so, we will need some input data files to call it. First, let’s create a JSON file with some dummy NetCDF file reference for demonstration purpose.

$ echo 'Test WPS' > /tmp/test.nc
$ echo '["file:///tmp/test.nc"]' > /tmp/test.json

Then, run the WPS-1/WPS-2 Execute request (built-in process jsonarray2netcdf) as follow:

$ curl -k "${WEAVER_URL}/ows/wps?service=wps&request=execute&identifier=jsonarray2netcdf&version=1.0.0 \
    &DataInputs=input=file:///tmp/test.json"

The execution of the process should read the JSON list with our dummy NetCDF file and make it available (as a copy) on the output parameter named output with a path matching the configured output WPS path of the application.

Note

All above WPS-1/2 requests suppose that configuration setting weaver.wps_path /ows/wps (default value). The request URL have to be adjusted accordingly if this parameter is modified.

Also, the provided file reference is relative where Weaver application is running. If you want to employ a remote server instance, you will have to either place the file on this server file system at a location Weaver has access to, or provide the file through an HTTP URL.

WPS-3 requests

All previous operations for listing available processes (GetCapabilities), describing or executing a WPS-1/2 process can also be accomplished using the WPS-3 REST JSON interface. For instance, listing processes is done like so:

$ curl -k "${WEAVER_URL}/processes"

Individual process details (DescribeProcess) can be obtained with the following method (e.g.: built-in process jsonarray2netcdf in this case):

$ curl -k "${WEAVER_URL}/processes/jsonarray2netcdf"

And execution of this process can be accomplished with the following request:

$ curl -X POST "${WEAVER_URL}/processes/jsonarray2netcdf/jobs" \
       -H "Content-Type: application/json" \
       -d '{"inputs": [{"id": "input", "href": "file:///tmp/test.json"}],
            "outputs": [{"id": "output", "transmissionMode": "reference"}],
            "response": "document",
            "mode": "async"}'

The JSON response should provide a location field specifying where the job status can be verified. Upon successful job completion, an output reference URL should have been generated just as with the WPS-1/2 example.

The WPS-3 interface allows further operations such as job monitoring, specific output listing, log reporting, etc. For all available operations and specific details about them, please refer to OpenAPI schemas (they will also be rendered on route ${WEAVER_URL}/api when running Weaver application).

Endpoint Content-Type

Todo

wps-1/2 xml default, json supported wps-2

Todo

wps-rest json only (for now, xml also if implemented) https://github.com/crim-ca/weaver/issues/125 https://github.com/crim-ca/weaver/issues/126

Next Steps

Have a look to the Processes, Package and FAQ sections.

The full OpenAPI Specification is also available for request details.

Processes

Type of Processes

Weaver supports multiple type of processes, as listed below. Each one of them are accessible through the same API interface, but they have different implications.

See also

Section Examples provides multiple concrete use cases of Deploy and Execute request payloads for diverse set of applications.

Builtin

These processes come pre-packaged with Weaver. They will be available directly on startup of the application and re-updated on each boot to make sure internal database references are updated with any source code changes.

Theses processes typically correspond to utility operations. They are specifically useful when employed as step within a Workflow process that requires data-type conversion between input/output of similar, but not perfectly, compatible definitions.

For example, process weaver.processes.builtin.jsonarray2netcdf takes a single input JSON file which its content contains an array-list of NetCDF file references, and returns them directly as the corresponding list of output files. These two different file formats (single JSON to multiple NetCDF) can then be used to map two processes with these respective output and inputs.

As of the latest release, following builtin processes are available:

All builtin processes are marked with weaver.processes.constants.CWL_REQUIREMENT_APP_BUILTIN in the CWL hints section and are all defined in weaver.processes.builtin.

WPS-1/2

This kind of process corresponds to a traditional WPS XML or JSON endpoint (depending of supported version) prior to WPS-REST specification. When the WPS-REST process is deployed in Weaver using an URL reference to an WPS-1/2 process, Weaver parses and converts the XML or JSON body of the response and registers the process locally using this definition. This allows a remote server offering limited functionalities (e.g.: no REST bindings supported) to provide them through Weaver.

A minimal Deploy request body for this kind of process could be as follows:

{
  "processDescription": {
    "process": {
      "id": "my-process-reference"
    }
  },
  "executionUnit": [
    {
      "href": "https://example.com/wps?service=WPS&request=DescribeProcess&identifier=my-process&version=1.0.0"
    }
  ]
}

This would tell Weaver to locally deploy the my-process-reference process using the WPS-1 URL reference that is expected to return a DescribeProcess XML schema. Provided that this endpoint can be resolved and parsed according to typical WPS specification, this should result into a successful process registration. The deployed process would then be accessible with DescribeProcess requests.

The above deployment procedure can be automated on startup using Weaver’s wps_processes.yml configuration file. Please refer to Configuration of WPS Processes section for more details on this matter.

Warning

Because Weaver creates a snapshot of the reference process at the moment it was deployed, the local process definition could become out-of-sync with the remote reference where the Execute request will be sent. Refer to Remote Provider section for more details to work around this issue.

See also

WPS-REST

This process type is the main component of Weaver. All other process types are converted to this one either through some parsing (e.g.: WPS-1/2) or with some requirement indicators (e.g.: Builtin, Workflow) for special handling.

When deploying one such process directly, it is expected to have a reference to a CWL Application Package. This is most of the time employed to wrap a reference docker image process. The reference package can be provided in multiple ways as presented below.

Note

When a process is deployed with any of the below supported Application Package formats, additional parsing of this CWL as well as complementary details directly within the WPS deployment body is accomplished. See Correspondance between CWL and WPS fields section for more details.

Package as Literal Unit Block

In this situation, the CWL definition is provided as is using JSON-formatted package embedded within the POST {WEAVER_URL}/processes (Deploy) request. The request payload would take the following shape:

{
  "processDescription": {
    "process": {
      "id": "my-process-reference"
    }
  },
  "executionUnit": [
    {
      "unit": {
        "cwlVersion": "v1.0",
        "class": "CommandLineTool",
        "inputs": ["<...>"],
        "outputs": ["<...>"],
        "<...>": "<...>"
      }
    }
  ]
}
ESGF-CWT

For traditional WPS-1 process type, Weaver adds default values to CWL definition. As we can see in weaver/processes/wps_package.py, the following default values for the CWL package are:

cwl_package = OrderedDict([
    ("cwlVersion", "v1.0"),
    ("class", "CommandLineTool"),
    ("hints", {
        CWL_REQUIREMENT_APP_WPS1: {
            "provider": get_url_without_query(wps_service_url),
            "process": process_id,
        }}),
])

In ESGF-CWT processes, ESGF-CWTRequirement hint must be used instead of usual WPS1Requirement, contained in the weaver.processes.constants.CWL_REQUIREMENT_APP_WPS1 variable. The handling of this technicality is handled in weaver/processes/wps_package.py. We can define ESGF-CWT processes using this syntax:

{
  "cwlVersion": "v1.0",
  "class": "CommandLineTool",
  "hints": {
    "ESGF-CWTRequirement": {
      "provider": "https://edas.nccs.nasa.gov/wps/cwt",
      "process": "xarray.subset"
    }
  }
}
Workflow

Processes categorized as Workflow are very similar to WPS-REST processes. From the API standpoint, they actually look exactly the same as an atomic process when calling DescribeProcess or Execute requests. The difference lies within the referenced Application Package which uses a CWL Workflow instead of typical CWL CommandLineTool, and therefore, modifies how the process is internally executed.

For Workflow processes to be deploy-able and executable, it is mandatory that Weaver is configured as EMS (see: Configuration Settings). This requirement is due to the nature of workflows that chain processes that need to be dispatched to known remote ADES servers (see: Configuration of Data Sources and Workflow Operations).

Given that a Workflow process was successfully deployed and that all process steps can be resolved, calling its Execute request will tell Weaver to parse the chain of operations and send step process execution requests to relevant ADES picked according to data sources. Each step’s job will then gradually be monitored from the remote ADES until completion, and upon successful result, the EMS will retrieve the data references to pass it down to the following step. When the complete chain succeeds, the final results of the last step will be provided as Workflow output as for atomic processes. In case of failure, the error will be indicated in the log with the appropriate step and message where the error occurred.

Note

Although chaining sub-workflow(s) within a bigger scoped workflow is technically possible, this have not yet been fully explored (tested) in Weaver. There is a chance that Data-Source resolution fails to identify where to dispatch the step in this situation. If this impacts you, please vote and indicate your concern on issue #171.

Remote Provider

Remote provider correspond to a remote service that provides similar interfaces as supported by Weaver (WPS-like). For example, a remote WPS-1 XML endpoint can be referenced as a provider. When an API Providers-scoped request is executed, for example to list is processes capabilities (see GetCapabilities), Weaver will send the corresponding request using the registered reference URL to access the remote server and reply with parsed response, as if they its processes were registered locally.

Since remote providers obviously require access to the remote service, Weaver will only be able to provide results if the service is accessible with respect to standard implementation features and supported specifications.

The main advantage of using Weaver’s endpoint rather than directly accessing the referenced remote provider processes is in the case of limited functionality offered by the service. For instance, WPS-1 do not always offer GetStatus feature, and there is no extensive job monitoring availability. Since Weaver wraps the original reference with its own endpoints, these features indirectly become employable. Similarly, although WPS-1 offer XML-only endpoints, the parsing operation accomplished by Weaver makes theses services available as WPS-REST JSON endpoints. On top of that, registering remote providers into Weaver allows the user to use it as a central hub to keep references to all his accessible services and dispatch jobs from a common location.

A remote provider differs from previously presented WPS-1/2 processes such that the underlying processes of the service are not registered locally. For example, if a remote service has two WPS processes, only top-level service URL will be registered locally (in Weaver’s database) and the application will have no explicit knowledge of these remote processes. When calling process-specific requests (e.g.: DescribeProcess or Execute), Weaver will re-send the corresponding request directly to the remote provider each time and return the result accordingly. On the other hand, a WPS-1/2 reference would be parsed and saved locally with the response at the time of deployment. This means that a deployed WPS-1/2 reference would act as a snapshot of the reference (which could become out-of-sync), while Remote Provider will dynamically update according to the re-fetched response from the remote service. If our example remote service was extended to have a third WPS process, it would immediately be reflected in GetCapabilities and DescribeProcess retrieved via Weaver Providers-scoped requests. This would not be the case for the WPS-1/2 reference that would need manual update (deploy the third process to register it in Weaver).

An example body of the register provider request could be as follows:

{
  "id": "my-service",
  "url": "https://example.com/wps",
  "public": true
}

Then, processes of this registered remote-provider will be accessible. For example, if the referenced service by the above URL add a WPS process identified by my-process, its JSON description would be obtained with following request (DescribeProviderProcess):

GET {WEAVER_URL}/providers/my-service/processes/my-process

Note

Process my-process in the example is not registered locally. From the point of view of Weaver’s processes (i.e.: route /processes/{id}), it does NOT exist. You must absolutely use the provider-prefixed route /providers/{id}/processes/{id} to explicitly fetch and resolve this remote process definition.

Warning

API requests scoped under Providers are Weaver-specific implementation. These are not part of OGC API - Processes specification.

Managing processes included in Weaver ADES/EMS

Following steps represent the typical steps applied to deploy a process, execute it and retrieve the results.

Register a new process (Deploy)

Deployment of a new process is accomplished through the POST {WEAVER_URL}/processes POST {WEAVER_URL}/processes (Deploy) request.

The request body requires mainly two components:

  • processDescription:
    Defines the process identifier, metadata, inputs, outputs, and some execution specifications. This mostly corresponds to information that corresponds to a traditional WPS definition.
  • executionUnit:
    Defines the core details of the Application Package. This corresponds to the explicit CWL definition that indicates how to execute the given application.

Upon deploy request, Weaver will either respond with a successful result, or with the appropriate error message, whether caused by conflicting ID, invalid definitions or other parsing issues. A successful process deployment will result in this process to become available for following steps.

Warning

When a process is deployed, it is not necessarily available immediately. This is because process visibility also needs to be updated. The process must be made public to allow its discovery. For updating visibility, please refer to the PUT {WEAVER_URL}/processes/{id}/visibility (Visibility) request.

After deployment and visibility preconditions have been met, the corresponding process should become available through DescribeProcess requests and other routes that depend on an existing process.

Note that when a process is deployed using the WPS-REST interface, it also becomes available through the WPS-1/2 interface with the same identifier and definition. Because of compatibility limitations, some parameters in the WPS-1/2 might not be perfectly mapped to the equivalent or adjusted WPS-REST interface, although this concerns mostly only new features such as status monitoring. For most traditional use cases, properties are mapped between the two interfaces, but it is recommended to use the WPS-REST one because of the added features.

Access registered process(es) (GetCapabilities, DescribeProcess)

Available processes can all be listed using GET {WEAVER_URL}/processes (GetCapabilities) request. This request will return all locally registered process summaries. Other return formats and filters are also available according to provided request query parameters. Note that processes not marked with public visibility will not be listed in this result.

For more specific process details, the GET {WEAVER_URL}/processes/{id} (DescribeProcess) request should be used. This will return all information that define the process references and expected inputs/outputs.

Note

For remote processes (see: Remote Provider), Provider requests are also available for more fine-grained search of underlying processes. These processes are not necessarily listed as local processes, and will therefore sometime not yield any result if using the typical DescribeProcess endpoint.

All routes listed under Process requests should normally be applicable for remote processes by prefixing them with /providers/{id}.

Execution of a process (Execute)

Process execution (i.e.: submitting a Job) is accomplished using the POST {WEAVER_URL}/processes/{id}/jobs (Execute) request. This section will first describe the basics of this request format, and after go into details for specific use cases and parametrization of various input/output combinations. Let’s employ the following example of JSON body sent to the Job execution to better illustrate the requirements.

{
  "mode": "async",
  "response": "document",
  "inputs": [
    {
      "id": "input-file",
      "href": "<some-file-reference"
    },
    {
      "id": "input-value",
      "data": 1,
    }
  ],
  "outputs": [
    {
      "id": "output",
      "transmissionMode": "reference"
    }
  ]
}
Basic Details

The first field is mode, it basically tells whether to run the Process in a blocking (sync) or non-blocking (async) manner. Note that support is currently limited for mode sync as this use case is often more cumbersome than async execution. Effectively, sync mode requires to have a task worker executor available to run the Job (otherwise it fails immediately due to lack of processing resource), and the requester must wait for the whole execution to complete to obtain the result. Given that Process could take a very long time to complete, it is not practical to execute them in this manner and potentially have to wait hours to retrieve outputs. Instead, the preferred and default approach is to request an async Job execution. When doing so, Weaver will add this to a task queue for processing, and will immediately return a Job identifier and location where the user can probe for its status, using GetStatus monitoring request. As soon as any task worker becomes available, it will pick any leftover queued Job to execute it.

The second field is response. At the time being, Weaver only supports document value. This parameter is present only for compatibility with other ADES implementation, but does not actually affects Weaver’s response.

Following are the inputs definition. This is the most important section of the request body. It defines which parameters to forward to the referenced Process to be executed. All id elements in this Job request body must correspond to valid inputs from the definition returned by DescribeProcess response. Obviously, all formatting requirements (i.e.: proper file MIME-types), data types (e.g.: int, string, etc.) and validations rules (e.g.: minOccurs, AllowedValues, etc.) must also be fulfilled. When providing files as input, multiple protocols are supported. See later section File Reference Types for details.

Finally, the outputs section defines, for each id corresponding to the Process definition, how to report the produced outputs from a successful Job completion. Again, Weaver only implement the reference result for the time being as this is the most common variation. In this case, the produced file is stored locally and exposed externally with returned reference URL. The other (unimplemented) mode value would return the contents directly in the response instead of the URL.

Note

Other parameters can be added to the request to provide further functionalities. Above fields are the minimum requirements to request a Job. Please refer to the OpenAPI Execute definition for all applicable features.

Note

Since most of the time, returned files are not human readable or are simply too large to be displayed, the transmissionMode: value is rarely employed. Also, it is to be noted that outputs representing LiteralData (which is even more uncommon) would automatically be represented as value without explicitly requesting it, as there would not be any file to return. If this poses problem or you encounter a valid use-case where value would be useful for your needs, please submit a new issue to request the feature.

Execution Steps

Once the Job is submitted, its status should initially switch to accepted. This effectively means that the Job is pending execution (task queued), but is not yet executing. When a worker retrieves it for execution, the status will change to started for preparation steps (i.e.: allocation resources, retrieving required parametrization details, etc.), followed by running when effectively reaching the execution step of the underlying Application Package operation. This status will remain as such until the operation completes, either with succeeded or failed status.

At any moment during async execution, the Job status can be requested using GET {WEAVER_URL}/processes/{id}/jobs/{id} (GetStatus). Note that depending on the timing at which the user executes this request and the availability of task workers, it could be possible that the Job be already in running state, or even failed in case of early problem detected.

When the Job reaches its final state, multiple parameters will be adjusted in the status response to indicate its completion, notably the completed percentage, time it finished execution and full duration. At that moment, the requests for retrieving either error details or produced outputs become accessible. Examples are presented in GetResult section.

Process Operations

Todo

detail ‘operations’ accomplished (stage-in, exec-cwl, stage-out)

Workflow Operations

Todo

same as prev + ‘operations’ (deploy based on data-source, visibility, exec-remote for each step, pull-result)

File Reference Types

Most inputs can be categorized into two of the most commonly employed types, namely LiteralData and ComplexData. The former represents basic values such as integers or strings, while the other represents a file reference. Files in Weaver (and WPS in general) can be specified with any formats as MIME-type.

See also

  • Correspondance between CWL and WPS fields

As for standard WPS, remote file references are usually limited to http(s) scheme, unless the process takes an input string and parses the unusual reference from the literal data to process it by itself. On the other hand, Weaver supports all following reference schemes.

  • http(s)://

  • file://

  • opensearchfile:// [experimental]

  • s3:// [experimental]

The method in which Weaver will handle such references depends on its configuration, in other words, whether it is running as ADES or EMS (see: Configuration), as well as depending on some other CWL package requirements. These use-cases are described below.

Warning

Missing schemes in URL reference are considered identical as if file:// was used. In most cases, if not always, an execution request should not employ this scheme unless the file is ensured to be at the specific location where the running Weaver application can find it. This scheme is usually only employed as byproduct of the fetch operation that Weaver uses to provide the file locally to underlying CWL application package to be executed.

When Weaver is able to figure out that the process needs to be executed locally in ADES mode, it will fetch all necessary files prior to process execution in order to make them available to the CWL package. When Weaver is in EMS configuration, it will always forward remote references (regardless of scheme) exactly as provided as input of the process execution request, since it assumes it needs to dispatch the execution to another ADES remote server, and therefore only needs to verify that the file reference is reachable remotely. In this case, it becomes the responsibility of this remote instance to handle the reference appropriately. This also avoids potential problems such as if Weaver as EMS doesn’t have authorized access to a link that only the target ADES would have access to.

When CWL package defines WPS1Requirement under hints for corresponding WPS-1/2 remote processes being monitored by Weaver, it will skip fetching of http(s)-based references since that would otherwise lead to useless double downloads (one on Weaver and the other on the WPS side). It is the same in case of ESGF-CWTRequirement employed for ESGF-CWT processes. Because these processes do not always support S3 buckets, and because Weaver supports many variants of S3 reference formats, it will first fetch the S3 reference using its internal AWS Configuration, and then expose this downloaded file as https(s) reference accessible by the remote WPS process.

Note

When Weaver is fetching remote files with http(s)://, it can take advantage of additional request options to support unusual or server-specific handling of remote reference as necessary. This could be employed for instance to attribute access permissions only to some given ADES server by providing additional authorization tokens to the requests. Please refer to Configuration of Request Options for this matter.

When using S3 references, Weaver will attempt to retrieve the file using server AWS Configuration and AWS Credentials. Provided that the corresponding S3 bucket can be accessed by the running Weaver application, it will fetch the file and store it locally temporarily for CWL execution.

Note

When using S3 buckets, authorization are handled through typical AWS credentials and role permissions. This means that AWS access must be granted to the application in order to allow it fetching the file. There are also different formats of S3 reference formats handled by Weaver. Please refer to Configuration of AWS S3 Buckets for more details.

When using OpenSearch references, additional parameters are necessary to handle retrieval of specific file URL. Please refer to OpenSearch Data Source for more details.

Following table summarize the default behaviour of input file reference handling of different situations when received as input argument of process execution. For simplification, keyword <any> is used to indicate that any other value in the corresponding column can be substituted for a given row when applied with conditions of other columns, which results to same operational behaviour. Elements that behave similarly are also presented together in rows to reduce displayed combinations.

Configuration

Process Type

File Scheme

Applied Operation

<any>

<any>

opensearchfile://

Query and re-process 1

ADES

file://

Convert to http(s):// 2

http(s)://

Nothing (left unmodified)

s3://

Fetch and convert to http(s):// 4

WPS-REST (CWL) 3

file://

Nothing (file already local)

http(s)://

Fetch and convert to file://

s3://

EMS

file://

Convert to http(s):// 2

http(s)://

Nothing (left unmodified)

s3://

Footnotes

1

References defined by opensearch:// will trigger an OpenSearch query using the provided URL as well as other input additional parameters (see OpenSearch Data Source). After processing of this query, retrieved file references will be re-processed using the summarized logic in the table for the given use case.

2(1,2,3)

When a file:// (or empty scheme) maps to a local file that needs to be exposed externally for another remote process, the conversion to http(s):// scheme employs setting weaver.wps_outputs_url to form the result URL reference. The file is placed in weaver.wps_outputs_dir to expose it as HTTP(S) endpoint.

3(1,2)

When the process refers to a remote WPS-REST process (i.e.: remote WPS instance that supports REST bindings but that is not necessarily an ADES), Weaver simply wraps and monitor its remote execution, therefore files are handled just as for any other type of remote WPS-like servers. When the process contains an actual CWL Application Package that defines a CommandLineTool (including Docker images), files are fetched as it will be executed locally. See CWL CommandLineTool, WPS-REST and Remote Providers for further details.

4

When an s3:// file is fetched, is gets downloaded to a temporary file:// location, which is NOT necessarily exposed as http(s)://. If execution is transferred to a remove process that is expected to not support S3 references, only then the file gets converted as in 2.

5

Workflows are only available on EMS instances. Since they chain processes, no fetch is needed as the first sub-step process will do it instead. See Workflow process as well as CWL Workflow for more details.

Todo

method to indicate explicit fetch to override these? (https://github.com/crim-ca/weaver/issues/183)

Todo

add tests that validate each combination of operation

OpenSearch Data Source

Todo

EOImage with AOI/TOI/CollectionId for OpenSearch

Multiple Inputs

Todo

repeating IDs example for WPS multi-inputs

Multiple Outputs

Although CWL allows output arrays, WPS does not support it directly, as only single values are allowed for WPS outputs according to original specification. To work around this, Metalink files can be used to provide a single output reference that embeds other references. This approach is also employed and preferred as described in PyWPS Multiple Outputs.

Todo

fix doc when Multiple Output is supported with metalink (https://github.com/crim-ca/weaver/issues/25)

Todo

add example of multi-output process definition

Todo

and how CWL maps them with WPS

Warning

This feature is being worked on (Weaver Issue #25). Direct support between

Email Notification

When submitting a job for execution, it is possible to provide the notification_email field. Doing so will tell Weaver to send an email to the specified address with successful or failure details upon job completion. The format of the email is configurable from weaver.ini.example file with email-specific settings (see: Configuration).

Monitoring of a process (GetStatus)

Todo

job status body example (success vs fail)

Obtaining output results, logs or errors

In the case of successful Job execution, the outputs can be retrieved with GET {WEAVER_URL}/processes/{id}/jobs/{id}/result (GetResult) request to list each corresponding output id with the generated file reference URL. Keep in mind that those URL’s purpose are only to fetch the results (not persistent storage), and could therefore be purged after some reasonable amount of time. The format should be similar to the following example, with minor variations according to Configurations:

{
  "outputs": [
    {
      "id": "output",
      "href": "{WEAVER_URL}/wpsoutputs/f93a15be-6e16-11ea-b667-08002752172a/output_netcdf.nc"
    }
  ]
}

In situations where the Job resulted into failed status, the GET {WEAVER_URL}/processes/{id}/jobs/{id}/exceptions (GetLogs) can be use to retrieve the potential cause of failure, by capturing any raised exception. Below is an example of such exception details.

[
  "builtins.Exception: Could not read status document after 5 retries. Giving up."
]

The returned exception are often better understood when compared against, or in conjunction with, the logs that provide details over each step of the operation.

Any Job executed by Weaver will provide minimal information log, such as operation setup, the moment when it started execution and latest status. The extent of other log entries will more often than not depend on the verbosity of the underlying process being executed. When executing an Application Package, Weaver tries as best as possible to collect standard output and error steams to report them through log and exception lists.

Since Weaver can only report as much details as provided by the running application, it is recommended by Application Package implementers to provide progressive status updates when developing their package in order to help understand problematic steps in event of process execution failures. In the case of remote WPS processes monitored by Weaver for example, this means gradually reporting process status updates (e.g.: calling WPSResponse.update_status if you are using |pywps|_, see: Progress and Status Report), while using print and/or logging operation for scripts or Docker images executed through CWL CommandLineTool.

Note

Job logs and exceptions are a Weaver-specific implementation. They are not part of traditional OGC API - Processes.

A minimalistic example of logging output is presented below. This can be retrieved using GET {WEAVER_URL}/processes/{id}/jobs/{id}/logs (GetLogs) request, at any moment during Job execution (with logs up to that point in time) or after its completion (for full output). Note again that the more the Process is verbose, the more tracking will be provided here.

[
  "[2020-03-24 21:32:32] INFO     [weaver.datatype.Job] 0:00:00   1% accepted   Job task setup completed.",
  "[2020-03-24 21:32:32] INFO     [weaver.datatype.Job] 0:00:00   2% accepted   Execute WPS request for process [jsonarray2netcdf]",
  "[2020-03-24 21:32:33] INFO     [weaver.datatype.Job] 0:00:01   4% accepted   Fetching job input definitions.",
  "[2020-03-24 21:32:33] INFO     [weaver.datatype.Job] 0:00:01   6% accepted   Fetching job output definitions.",
  "[2020-03-24 21:32:33] INFO     [weaver.datatype.Job] 0:00:01   8% accepted   Starting job process execution",
  "[2020-03-24 21:32:34] INFO     [weaver.datatype.Job] 0:00:01  10% accepted   Verifying job status location.",
  "[2020-03-24 21:32:34] WARNING  [weaver.datatype.Job] 0:00:01  10% accepted   WPS status location could not be found",
  "[2020-03-24 21:32:34] INFO     [weaver.datatype.Job] 0:00:01  20% running    Starting monitoring of job execution.",
  "[2020-03-24 21:33:59] INFO     [weaver.datatype.Job] 0:01:26  90% succeeded  [2020-03-24 17:32:34] INFO     [wps_package.jsonarray2netcdf]    1% running    Preparing package logs done.",
  "[2020-03-24 21:33:59] INFO     [weaver.datatype.Job] 0:01:26  90% succeeded  [2020-03-24 17:32:34] INFO     [wps_package.jsonarray2netcdf]    2% running    Launching package...",
  "[2020-03-24 21:33:59] INFO     [weaver.datatype.Job] 0:01:26  90% succeeded  [2020-03-24 17:32:34] INFO     [cwltool] Resolved '/tmp/tmpse3pi1gj/jsonarray2netcdf' to 'file:///tmp/tmpse3pi1gj/jsonarray2netcdf'",
  "[2020-03-24 21:33:59] INFO     [weaver.datatype.Job] 0:01:26  90% succeeded  [2020-03-24 17:32:34] INFO     [cwltool] ../../../../../tmp/tmpse3pi1gj/jsonarray2netcdf:1:1: Unknown hint",
  "[2020-03-24 21:33:59] INFO     [weaver.datatype.Job] 0:01:26  90% succeeded                                                       file:///tmp/tmpse3pi1gj/BuiltinRequirement",
  "[2020-03-24 21:33:59] INFO     [weaver.datatype.Job] 0:01:26  90% succeeded  [2020-03-24 17:32:34] INFO     [wps_package.jsonarray2netcdf]    5% running    Loading package content done.",
  "[2020-03-24 21:33:59] INFO     [weaver.datatype.Job] 0:01:26  90% succeeded  [2020-03-24 17:32:34] INFO     [wps_package.jsonarray2netcdf]    6% running    Retrieve package inputs done.",
  "[2020-03-24 21:33:59] INFO     [weaver.datatype.Job] 0:01:26  90% succeeded  [2020-03-24 17:32:34] INFO     [wps_package.jsonarray2netcdf]    8% running    Convert package inputs done.",
  "[2020-03-24 21:33:59] INFO     [weaver.datatype.Job] 0:01:26  90% succeeded  [2020-03-24 17:32:34] INFO     [wps_package.jsonarray2netcdf]   10% running    Running package...",
  "[2020-03-24 21:33:59] INFO     [weaver.datatype.Job] 0:01:26  90% succeeded  [2020-03-24 17:32:34] INFO     [cwltool] [job jsonarray2netcdf] /tmp/tmpqy1t8dp3$ python \\",
  "[2020-03-24 21:33:59] INFO     [weaver.datatype.Job] 0:01:26  90% succeeded      /opt/weaver/processes/builtin/jsonarray2netcdf.py \\",
  "[2020-03-24 21:33:59] INFO     [weaver.datatype.Job] 0:01:26  90% succeeded      -o \\",
  "[2020-03-24 21:33:59] INFO     [weaver.datatype.Job] 0:01:26  90% succeeded      /tmp/tmpqy1t8dp3 \\",
  "[2020-03-24 21:33:59] INFO     [weaver.datatype.Job] 0:01:26  90% succeeded      -i \\",
  "[2020-03-24 21:33:59] INFO     [weaver.datatype.Job] 0:01:26  90% succeeded      /tmp/tmpla2utn2c/stgb5787338-4a34-4771-88c0-cae95f4d82dd/test_nc_array.json",
  "[2020-03-24 21:33:59] INFO     [weaver.datatype.Job] 0:01:26  90% succeeded  [2020-03-24 17:32:41] INFO     [cwltool] [job jsonarray2netcdf] Max memory used: 36MiB",
  "[2020-03-24 21:33:59] INFO     [weaver.datatype.Job] 0:01:26  90% succeeded  [2020-03-24 17:32:41] INFO     [cwltool] [job jsonarray2netcdf] completed success",
  "[2020-03-24 21:33:59] INFO     [weaver.datatype.Job] 0:01:26  90% succeeded  [2020-03-24 17:32:41] INFO     [wps_package.jsonarray2netcdf]   95% running    Package execution done.",
  "[2020-03-24 21:33:59] INFO     [weaver.datatype.Job] 0:01:26  90% succeeded  [2020-03-24 17:33:53] INFO     [wps_package.jsonarray2netcdf]   98% running    Generate package outputs done.",
  "[2020-03-24 21:33:59] INFO     [weaver.datatype.Job] 0:01:26  90% succeeded  [2020-03-24 17:33:55] INFO     [wps_package.jsonarray2netcdf]  100% succeeded  Package complete.",
  "[2020-03-24 21:33:59] INFO     [weaver.datatype.Job] 0:01:26  90% succeeded  Job succeeded (status: Package complete.).",
  "[2020-03-24 21:34:45] INFO     [weaver.datatype.Job] 0:01:26  90% succeeded  Job succeeded.",
  "[2020-03-24 21:34:45] INFO     [weaver.datatype.Job] 0:01:26 100% succeeded  Job task complete."
]

Special Weaver EMS use-cases

This section highlight the additional behaviour available only through an EMS-configured Weaver instance. Some other points are already described in other sections, but are briefly indicated here for conciseness.

ADES dispatching using Data-Sources

Todo

add details, data-source defines where to send request of known ADES

Todo

reference config weaver.data_sources

Workflow (Chaining Step Processes)

Todo

add details, explanation done in below reference

See also

Application Package

The Application Package defines the internal script definition and configuration that will be executed by a Process. This package is based on Common Workflow Language (CWL). Using the extensive CWL Specification as backbone for internal execution of the process allows it to run multiple type of applications, whether they are referenced to by Docker image, scripts (bash, python, etc.), some remote Process and more.

Note

The large community and use cases covered by CWL makes it extremely versatile. If you encounter any issue running your Application Package in Weaver (such as file permissions for example), chances are that there exists a workaround somewhere in the CWL Specification. Most typical problems are usually handled by some flag or argument in the CWL definition, so this reference should be explored first. Please also refer to FAQ section as well as existing Weaver issues. Ultimately if no solution can be found, open an new issue about your specific problem.

All processes deployed locally into Weaver using a CWL package definition will have their full package definition available with GET {WEAVER_URL}/processes/{id}/package (Package) request.

Note

The package request is a Weaver-specific implementation, and therefore, is not necessarily available on other ADES/EMS implementation as this feature is not part of OGC API - Processes specification.

Typical CWL Package Definition

CWL CommandLineTool

Following CWL package definition represents the weaver.processes.builtin.jsonarray2netcdf process.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/usr/bin/env cwl-runner
cwlVersion: v1.0
class: CommandLineTool
# target the installed python pointing to weaver conda env to allow imports
baseCommand: python
arguments:
  - "${WEAVER_ROOT_DIR}/weaver/processes/builtin/jsonarray2netcdf.py"
  - "-o"
  - "$(runtime.outdir)"
inputs:
 input:
   type: File
   format: iana:application/json
   inputBinding:
     position: 1
     prefix: "-i"
outputs:
 output:
   format: edam:format_3650
   type:
     type: array
     items: File
   outputBinding:
     glob: "*.nc"
$namespaces:
  iana: "https://www.iana.org/assignments/media-types/"
  edam: "http://edamontology.org/"

The first main components is the class: CommandLineTool that tells Weaver it will be a base process (contrarily to CWL Workflow presented later).

The other important sections are inputs and outputs. These define which parameters will be expected and produced by the described application. Weaver supports most formats and types as specified by CWL Specification. See Inputs/Outputs Type for more details.

CWL Workflow

Weaver also supports CWL class: Workflow. When an Application Package is defined this way, the Process deployment operation will attempt to resolve each step as another process. The reference to the CWL definition can be placed in any location supported as for the case of atomic processes (see details about supported package locations).

The following CWL definition demonstrates an example Workflow process that would resolve each step with local processes of match IDs.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
{
    "cwlVersion": "v1.0",
    "class": "Workflow",
    "requirements": [
        {
            "class": "StepInputExpressionRequirement"
        }
    ],
    "inputs": {
        "tasmax": {
            "type": {
                "type": "array",
                "items": "File"
            }
        },
        "lat0": "float",
        "lat1": "float",
        "lon0": "float",
        "lon1": "float",
        "freq": {
            "default": "YS",
            "type": {
                "type": "enum",
                "symbols": ["YS", "MS", "QS-DEC", "AS-JUL"]
            }
        }
    },
    "outputs": {
        "output": {
            "type": "File",
            "outputSource": "ice_days/output_netcdf"
        }
    },
    "steps": {
        "subset": {
            "run": "ColibriFlyingpigeon_SubsetBbox.cwl",
            "in": {
                "resource": "tasmax",
                "lat0": "lat0",
                "lat1": "lat1",
                "lon0": "lon0",
                "lon1": "lon1"
            },
            "out": ["output"]
        },
        "json2nc": {
            "run": "jsonarray2netcdf",
            "in": {
                "input": "subset/output"
            },
            "out": ["output"]
        },
        "ice_days": {
            "run": "Finch_IceDays.cwl",
            "in": {
                "tasmax": "json2nc/output",
                "freq": "freq"
            },
            "out": ["output_netcdf"]
        }
    }
}

For instance, the jsonarray2netcdf (Builtin) middle step in this example corresponds to the CWL CommandLineTool process presented in previous section. Other processes referenced in this Workflow can be found in Weaver Test Resources.

Steps processes names are resolved using the variations presented below. Important care also needs to be given to inputs and outputs definitions between each step.

Step Reference

In order to resolve referenced processes as steps, Weaver supports 3 formats.

  1. Process ID explicitly given.
    Any visible process from GET {WEAVER_URL}/processes (GetCapabilities) response should be resolved this way.
    (e.g.: jsonarray2netcdf resolves to pre-deployed weaver.processes.builtin.jsonarray2netcdf).
  2. Full URL to the process description endpoint, provided that it also offers a GET {WEAVER_URL}/processes/{id}/package (Package) endpoint (Weaver-specific).

  3. Full URL to the explicit CWL file (usually corresponding to (2) or the href provided in deployment body).

When an URL to the CWL process “file” is provided with an extension, it must be one of the supported values defined in weaver.processes.wps_package.PACKAGE_EXTENSIONS. Otherwise, Weaver will refuse it as it cannot figure out how to parse it.

Because Weaver and the underlying CWL executor need to resolve all steps in order to validate their input and output definitions correspond (id, format, type, etc.) in order to chain them, all intermediate processes MUST be available. This means that you cannot Register a new process (Deploy) nor Execution of a process (Execute) a Workflow-flavored Application Package until all referenced steps have themselves been deployed and made visible.

Warning

Because Weaver needs to convert given CWL documents into equivalent WPS process definition, embedded CWL processes within a Workflow step are not supported currently. This is a known limitation of the implementation, but not much can be done against it without major modifications to the code base. See also issue #56.

Step Inputs/Outputs

Inputs and outputs of connected steps are required to match types and formats in order for the workflow to be valid. This means that a process that produces an output of type String cannot be directly chained to a process that takes as input a File, even if the String of the first process represents an URL that could be resolved to a valid file reference. In order to chain two such processes, an intermediate operation would need to be defined to explicitly convert the String input to the corresponding File output. This is usually accomplished using Builtin processes, such as in the previous example.

Since formats must also match (e.g.: a process producing application/json cannot be mapped to one producing application/x-netcdf), all mismatching formats must also be converted with an intermediate step if such operation is desired. This ensures that workflow definitions are always explicit and that as little interpretation, variation or assumptions are possible between each execution. Because of this, all application generated by Weaver will attempt to preserve and enforce matching input/output format definition in both CWL and WPS as long as it does not introduce ambiguous results (see File Format for more details).

Correspondence between CWL and WPS fields

Because CWL definition and WPS process description inherently provide “duplicate” information, many fields can be mapped between one another. In order to handle any provided metadata in the various supported locations by both specifications, as well as to extend details of deployed processes, each Application Package get its details merged with complementary WPS description.

In some cases, complementary details are only documentation-related, but some information directly affect the format or execution behaviour of some parameters. A common example is the maxOccurs field provided by WPS that does not have an exactly corresponding specification in CWL (any-sized array). On the other hand, CWL also provides data preparation steps such as initial staging (i.e.: InitialWorkDirRequirement) that doesn’t have an equivalent under the WPS process description. For this reason, complementary details are merged and reflected on both sides (as applicable), when non-ambiguous resolution is possible.

In case of conflicting metadata, the CWL specification will most of the time prevail over the WPS metadata fields simply because it is expected that a strict CWL specification is provided upon deployment. The only exceptions to this situation are when WPS specification help resolve some ambiguity or when WPS enforces the parametrisation of some elements, such as with maxOccurs field.

Note

Metadata merge operation between CWL and WPS is accomplished on per-mapped-field basis. In other words, more explicit details such as maxOccurs could be obtained from WPS and simultaneously the same input’s format could be obtained from the CWL side. Merge occurs bidirectionally for corresponding information.

The merging strategy of process specifications also implies that some details can be omitted from one context if they can be inferred from corresponding elements in the other. For example, the CWL and WPS context both define keywords (with minor naming variation) as a list of strings. Specifying this metadata in both locations is redundant and only makes the process description longer. Therefore, the user is allowed to provide only one of the two and Weaver will take care to propagate the information to the lacking location.

In order to help understand the resolution methodology between the contexts, following sub-section will cover supported mapping between the two specifications, and more specifically, how each field impacts the mapped equivalent metadata.

Warning

Merging of corresponding fields between CWL and WPS is a Weaver-specific implementation. The same behaviour is not necessarily supported by other implementations. For this reason, any converted information between the two contexts will be transferred to the other context if missing in order for both specification to reflect the similar details as closely as possible, wherever context the metadata originated from.

Inputs/Outputs ID

Inputs and outputs (I/O) id from the CWL context will be respectively matched against corresponding id or identifier field from I/O of WPS context. In the CWL definition, all of the allowed I/O structures are supported, whether they are specified using an array list with explicit definitions, using “shortcut” variant, or using key-value pairs (see CWL Mapping for more details). Regardless of array or mapping format, CWL requires that all I/O have unique id. On the WPS side, a list of I/O is always expected. This is because WPS I/O with multiple values (array in CWL) are specified by repeating the id with each value instead of defining the value as a list of those values during Execution of a process (Execute) request (see also Multiple Inputs).

To summarize, the following CWL and WPS I/O definitions are all equivalent and will result into the same process definition after deployment. For simplification purpose, below examples omit all but mandatory fields (only of the inputs and outputs portion of the full deployment body) to produce the same result. Other fields are discussed afterward in specific sections.

CWL I/O objects array
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
{
  "inputs": [
    {
      "id": "single-str",
      "type": "string"
    },
    {
      "id": "multi-file",
      "type": "File[]"
    }
  ],
  "outputs": [
    {
      "id": "output-1",
      "type": "File"
    },
    {
      "id": "output-2",
      "type": "File"
    }
  ]
}
CWL I/O key-value mapping
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
{
  "inputs": {
    "single-str": {
      "type": "string"
    },
    "multi-file": {
      "type": "File[]"
    }
  },
  "outputs": {
    "output-1": {
      "type": "File"
    },
    "output-2": {
      "type": "File"
    }
  }
}
WPS I/O definition
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
{
  "inputs": [
    {
      "id": "single-str"
    },
    {
      "id": "multi-file",
      "formats": []
    }
  ],
  "outputs": [
    {
      "id": "output-1",
      "formats": []
    },
    {
      "id": "output-2",
      "formats": []
    }
  ]
}

The WPS example above requires a format field for the corresponding CWL File type in order to distinguish it from a plain string. More details are available in Inputs/Outputs Type below about this requirement.

Finally, it is to be noted that above CWL and WPS definitions can be specified in the Register a new process (Deploy) request body with any of the following variations:

  1. Both are simultaneously fully specified (valid although extremely verbose).

  2. Both partially specified as long as sufficient complementary information is provided.

  3. Only CWL I/O is fully provided (with empty or even unspecified inputs or outputs section from WPS).

Warning

Weaver assumes that its main purpose is to eventually execute an Application Package and will therefore prioritize specification in CWL over WPS. Because of this, any unmatched id from the WPS context against provided CWL ids of the same I/O section will be dropped, as they ultimately would have no purpose during CWL execution.

This does not apply in the case of referenced WPS-1/2 processes since no CWL is available in the first place.

Inputs/Outputs Type

In the CWL context, the type field indicates the type of I/O. Available types are presented in the CWLType Symbols portion of the specification.

Warning

Weaver has two unsupported CWL type, namely Any and Directory. This limitation is intentional as WPS does not offer equivalents. Furthermore, both of these types make the process description too ambiguous. For instance, most processes expect remote file references, and providing a Directory doesn’t indicate an explicit reference to which files to retrieve during stage-in operation of a job execution.

In the WPS context, three data types exist, namely Literal, BoundingBox and Complex data.

As presented in the example of the previous section, I/O in the WPS context does not require an explicit indication of the type from one of Literal, BoundingBox and Complex data. Instead, WPS type is inferred using the matched API schema of the I/O. For instance, Complex I/O (i.e.: file reference) requires the formats field to distinguish it from a plain string. Therefore, specifying either format in CWL or formats in WPS immediately provides all needed information for Weaver to understand that this I/O is expected to be a file reference. A crs field would otherwise indicate a BoundingBox I/O (see note). If none of the two previous schemas are matched, the I/O type resolution falls back to Literal data of string type. To employ another primitive data type such as Integer, an explicit indication needs to be provided as follows.

WPS Literal Data Type
1
2
3
4
5
6
{
  "id": "input",
  "literalDataDomains": [
    {"dataType": {"name": "integer"}}
  ]
}

Obviously, the equivalent CWL definition is simpler in this case (i.e.: only type: int is required). It is therefore recommended to take advantage of Weaver’s merging strategy in this case by providing only the details through the CWL definition and have the corresponding WPS I/O type automatically deduced by the generated process. If desired, literalDataDomains can still be explicitly provided as above to ensure that it gets parsed as intended type.

Note

As of the current version of Weaver, WPS data type BoundingBox is not supported. The schema definition exists in WPS context but is not handled by any CWL type conversion yet. This feature is reflected by issue #51. It is possible to use a Literal data of type string corresponding to WKT 1, 2 in the meantime.

1

WKT Examples

2

WKT Formats

File Format

An input or output resolved as CWL File type, equivalent to a WPS ComplexData, supports format specification. Every mimeType field nested under formats entries of the WPS definition will be mapped against corresponding namespaced format of CWL.

For example, the following input definitions are equivalent in both contexts.

WPS Format with MIME-type
1
2
3
4
5
6
7
{
  "id": "input",
  "formats": [
    {"mimeType": "application/x-netcdf"},
    {"mimeType": "application/json"}
  ]
}
CWL Format with Namespace
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
{
  "inputs": [
    {
      "id": "input",
      "format": [
        "edam:format_3650",
        "iana:application/json"
      ]
    }
  ],
  "$namespaces": {
    "edam": "http://edamontology.org/",
    "iana": "https://www.iana.org/assignments/media-types/"
  }
}

As demonstrated, both contexts accept multiple formats for inputs. These effectively represent supported formats by the underlying application. The two MIME-types selected for this example are chosen specifically to demonstrate how CWL formats must be specified. More precisely, CWL requires a real schema definition referencing to an existing ontology to validate formats, specified through the $namespaces section. Each format entry is then defined as a mapping of the appropriate namespace to the identifier of the ontology. Alternatively, you can also provide the full URL of the ontology reference in the format string.

Like many other fields, this information can become quite rapidly redundant and difficult to maintain. For this reason, Weaver will automatically fill the missing detail if only one of the two corresponding information between CWL and WPS is provided. In other words, an application developer could only specify the I/O’s formats in the WPS portion during process deployment, and Weaver will take care to update the matching CWL definition without any user intervention. This makes it also easier for the user to specify supported formats since it is generally easier to remember names of MIME-types than full ontology references. Weaver has a large set of commonly employed MIME-types that it knows how to convert to corresponding ontologies. Also, Weaver will look for new MIME-types it doesn’t explicitly know about onto either the IANA or the EDAM ontologies in order to attempt automatically resolving them.

When formats are resolved between the two contexts, Weaver applies information in a complimentary fashion. This means for example that if the user provided application/x-netcdf on the WPS side and iana:application/json on the CWL side, both resulting contexts will have both of those formats combined. Weaver will not favour one location over the other, but will rather merge them if they can be resolved into different and valid entities.

Since format is a required field for WPS ComplexData definitions (see Inputs/Outputs Type) and that MIME-types are easier to provide in this context, it is recommended to provide all of them in the WPS definition.

Output File Format

Warning

Format specification differs between CWL and WPS in the case of outputs.

Although WPS definition allows multiple supported formats for output that are later resolved to the applied one onto the produced result of the job, CWL only considers the output format that directly indicates the applied schema. There is no concept of supported format in the CWL world. This is simply because CWL cannot predict nor reliably determine which output will be produced by a given application execution without running it, and therefore cannot expose consistent output specification before running the process. Because CWL requires to validate the full process integrity before it can be executed, this means that only a single output format is permitted in its context (providing many will raise a validation error when parsing the CWL definition).

To ensure compatibility with multiple supported formats outputs of WPS, any output that has more that one format will have its format field dropped in the corresponding CWL definition. Without any format on the CWL side, the validation process will ignore this specification and will effectively accept any type of file. This will not break any execution operation with CWL, but it will remove the additional validation layer of the format (which especially deteriorates process resolution when chaining processes inside a CWL Workflow).

If the WPS output only specifies a single MIME-type, then the equivalent format (after being resolved to a valid ontology) will be preserved on the CWL side since the result is ensured to be the unique one provided. For this reason, processes with specific single-format output are be preferred whenever possible. This also removes ambiguity in the expected output format, which usually requires a toggle input specifying the desired type for processes providing a multi-format output. It is instead recommended to produce multiple processes with a fixed output format for each case.

Allowed Values

Allowed values in the context of WPS LiteralData provides a mean for the application developer to restrict inputs to a specific set of values. In CWL, the same can be achieved using an enum definition. Therefore, the following two variants are equivalent and completely interchangeable.

WPS AllowedValues Input
1
2
3
4
5
6
{
  "id": "input",
  "literalDataDomains": [
    {"allowedValues": ["value-1", "value-2"]}
  ]
}
CWL Enum Values
1
2
3
4
5
6
7
{
  "id": "input",
  "type": {
    "type": "enum",
    "symbols": ["value-1", "value-2"]
  }
}

Weaver will ensure to propagate such definitions bidirectionally in order to update the CWL or WPS correspondingly with the provided information in the other context if missing. The primitive type to apply to a missing WPS specification when resolving it from a CWL definition is automatically inferred with the best matching type from provided values in the enum list.

Note that enum such as these will also be applied on top of Multiple and Optional Values definitions presented next.

Multiple and Optional Values

Inputs that take multiple values or references can be specified using minOccurs and maxOccurs in WPS context, while they are specified using the array type in CWL. While the same minOccurs parameter with a value of zero (0) can be employed to indicate an optional input, CWL requires the type to specify null or to use the shortcut ? character suffixed to the base type to indicate optional input. Resolution between WPS and CWL for the merging strategy implies all corresponding parameter combinations and checks in this case.

Because CWL does not take an explicit amount of maximum occurrences, information in this case are not necessarily completely interchangeable. In fact, WPS is slightly more verbose and easier to define in this case than CWL because all details are contained within the same two parameters. Because of this, it is often preferable to provide the minOccurs and maxOccurs in the WPS context, and let Weaver infer the array and/or null type requirements automatically. Also, because of all implied parameters in this situation to specify the similar details, it is important to avoid providing contradicting specifications as Weaver will have trouble guessing the intended result when merging specifications. If unambiguous guess can be made, CWL will be employed as deciding definition to resolve erroneous mismatches (as for any other corresponding fields).

Todo

update warning according to Weaver issue #25

Warning

Parameters minOccurs and maxOccurs are not permitted for outputs in the WPS context. Native WPS therefore does not permit multiple output reference files. This can be worked around using a Metalink file, but this use case is not covered by Weaver yet as it requires special mapping with CWL that does support array type as output (see issue #25).

Note

Although WPS multi-value inputs are defined as a single entity during deployment, special care must be taken to the format in which to specify these values during execution. Please refer to Multiple Inputs section of Execution of a process (Execute) request.

Following are a few examples of equivalent WPS and CWL definitions to represent multiple values under a given input. Some parts of the following definitions are purposely omitted to better highlight the concise details of multiple and optional information.

WPS Multi-Value Input (required)
1
2
3
4
5
6
{
  "id": "input-multi-required",
  "format": "application/json",
  "minOccurs": 1,
  "maxOccurs": "unbounded"
}
CWL Multi-Value Input (required)
1
2
3
4
5
6
7
{
  "id": "input-multi-required",
  "format": "iana:application/json",
  "type": {
    "type": "array", "items": "File"
  }
}

Todo

minOccurs/maxOccurs + array + WPS repeats IDs vs CWL as list

Todo

example multi-value + enum

It can be noted from the examples that minOccurs and maxOccurs can be either an integer or a string representing one. This is to support backward compatibility of older WPS specification that always employed strings although representing numbers. Weaver understands and handles both cases. Also, maxOccurs can have the special string value "unbounded", in which case the input is considered to be allowed an unlimited amount if entries (although often capped by another implicit machine-level limitation such as memory capacity). In the case of CWL, an array is always considered as unbounded, therefore WPS is the only context that can limit this amount.

Metadata

Todo

(s:)keywords field, doc/label vs abstract/title per-I/O and overall process, etc?

Example: cwl-metadata

Process and Application Package Examples

The principal source of examples can be found directly within Weaver functional tests. Most Process listed in this repository employ an Application Package defined using a locally provided CWL. Some other cases will refer to pre-deployed WPS processes. Refer to corresponding Deploy request payloads, also provided in that location, that will indicate the kind of Process definition employed through their executionUnit specification. Once successfully deployed on a ADES or EMS, the also provided Execute request body can be employed as format reference to run the operation (input values can be modified).

The general naming convention is:

  • DeployProcess_<PROCESS_ID>.json for the Deploy request payload.

  • Execute_<PROCESS_ID>.json for the Execute request payload.

  • <PROCESS_ID>.cwl for the CWL Application Package when applicable.

Note

There can be minor variations (camel/snake case, upper/lower case) of the exact <PROCESS_ID> employed in the file names according to the different reference repositories.

Further examples are also available following OGC Testbeds developments. The produced applications in this case can be found in OGC-Testbeds Applications. In that repository, the above naming convention will sometime be employed, but each Process is contained within its own sub-directory. Another naming conversion is sometime used, although the files provide equivalent details:

  • <PROCESS_ID>/deploy.json for the Deploy request payload.

  • <PROCESS_ID>/execute.json for the Execute request payload.

  • <PROCESS_ID>/package.cwl for the CWL Application Package when applicable.

OpenAPI Specification

API Reference

This page contains auto-generated API reference documentation 1.

weaver

Subpackages
weaver.database
Submodules
weaver.database.base
Module Contents
weaver.database.base.StoreSelector[source]
class weaver.database.base.DatabaseInterface(: weaver.typedefs.AnySettingsContainer, _)[source]

Return the unique identifier of db type matching settings.

static _get_store_type(store_type: StoreSelector)str[source]
abstract get_store(self, store_type, *store_args, **store_kwargs)[source]
abstract reset_store(self: StoreSelector, store_type)None[source]
abstract get_session(self)[source]
abstract get_information(self)weaver.typedefs.JSON[source]
Returns

{‘version’: version, ‘type’: db_type}

abstract is_ready(self)bool[source]
abstract run_migration(self)None[source]
weaver.database.mongodb
Module Contents
weaver.database.mongodb.MongoDB :Optional[Database][source]
weaver.database.mongodb.MongodbStores[source]
weaver.database.mongodb.AnyMongodbStore[source]
class weaver.database.mongodb.MongoDatabase(: weaver.typedefs.AnySettingsContainer, container)[source]

Return the unique identifier of db type matching settings.

_database[source]
_settings[source]
_stores[source]
type = mongodb[source]
reset_store(self, store_type)[source]
get_store(self: Union[str, Type[weaver.store.base.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)Any[source]
get_information(self)weaver.typedefs.JSON[source]
Returns

{‘version’: version, ‘type’: db_type}

is_ready(self)bool[source]
run_migration(self)None[source]
weaver.database.mongodb.get_mongodb_connection(container: weaver.typedefs.AnySettingsContainer)pymongo.database.Database[source]

Obtains the basic database connection from settings.

weaver.database.mongodb.get_mongodb_engine(container: weaver.typedefs.AnySettingsContainer)pymongo.database.Database[source]

Obtains the database with configuration ready for usage.

Package Contents
weaver.database.LOGGER[source]
weaver.database.get_db(container: weaver.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.

weaver.database.includeme(config)[source]
weaver.processes
Subpackages
weaver.processes.builtin
Submodules
weaver.processes.builtin.file2string_array
Module Contents
weaver.processes.builtin.file2string_array.CUR_DIR[source]
weaver.processes.builtin.file2string_array.PACKAGE_NAME[source]
weaver.processes.builtin.file2string_array.LOGGER[source]
weaver.processes.builtin.file2string_array.OUTPUT_CWL_JSON = cwl.output.json[source]
weaver.processes.builtin.file2string_array.main(input_file: argparse.FileType, output_dir: str)None[source]
weaver.processes.builtin.file2string_array.PARSER[source]
weaver.processes.builtin.jsonarray2netcdf

Extracts and fetches NetCDF files from a JSON file containing an URL string array, and provides them on the output directory.

Module Contents
weaver.processes.builtin.jsonarray2netcdf.CUR_DIR[source]
weaver.processes.builtin.jsonarray2netcdf.PACKAGE_NAME[source]
weaver.processes.builtin.jsonarray2netcdf.LOGGER[source]
weaver.processes.builtin.jsonarray2netcdf.j2n(json_reference: str, output_dir: str)None[source]
weaver.processes.builtin.jsonarray2netcdf.main()[source]
weaver.processes.builtin.metalink2netcdf

Extracts and fetches NetCDF files from a Metalink file containing an URL, and outputs the NetCDF file at a given index of the list.

Module Contents
weaver.processes.builtin.metalink2netcdf.CUR_DIR[source]
weaver.processes.builtin.metalink2netcdf.PACKAGE_NAME[source]
weaver.processes.builtin.metalink2netcdf.LOGGER[source]
weaver.processes.builtin.metalink2netcdf.m2n(metalink_reference: str, index: int, output_dir: str)None[source]
weaver.processes.builtin.metalink2netcdf.main()[source]
weaver.processes.builtin.utils
Module Contents
weaver.processes.builtin.utils.is_netcdf_url(url: Any)bool[source]
Package Contents
weaver.processes.builtin.register_builtin_processes(container: weaver.typedefs.AnySettingsContainer)None[source]

Registers every builtin CWL package to the processes database.

CWL definitions must be located within the weaver.processes.builtin module.

class weaver.processes.builtin.BuiltinProcess(toolpath_object: MutableMapping[str, Any], loadingContext: cwltool.context.LoadingContext)[source]

Initialize this CommandLineTool.

make_job_runner(self: cwltool.context.RuntimeContext, runtime_context)Type[cwltool.job.JobBase][source]
Submodules
weaver.processes.constants
Module Contents
weaver.processes.constants.WPS_INPUT = input[source]
weaver.processes.constants.WPS_OUTPUT = output[source]
weaver.processes.constants.WPS_COMPLEX = complex[source]
weaver.processes.constants.WPS_BOUNDINGBOX = bbox[source]
weaver.processes.constants.WPS_LITERAL = literal[source]
weaver.processes.constants.WPS_REFERENCE = reference[source]
weaver.processes.constants.WPS_COMPLEX_DATA = ComplexData[source]
weaver.processes.constants.OPENSEARCH_START_DATE = StartDate[source]
weaver.processes.constants.OPENSEARCH_END_DATE = EndDate[source]
weaver.processes.constants.OPENSEARCH_AOI = aoi[source]
weaver.processes.constants.OPENSEARCH_COLLECTION = collection[source]
weaver.processes.constants.OPENSEARCH_LOCAL_FILE_SCHEME = opensearchfile[source]
weaver.processes.constants.CWL_REQUIREMENT_APP_BUILTIN = BuiltinRequirement[source]
weaver.processes.constants.CWL_REQUIREMENT_APP_DOCKER = DockerRequirement[source]
weaver.processes.constants.CWL_REQUIREMENT_APP_DOCKER_GPU = DockerGpuRequirement[source]
weaver.processes.constants.CWL_REQUIREMENT_APP_ESGF_CWT = ESGF-CWTRequirement[source]
weaver.processes.constants.CWL_REQUIREMENT_APP_WPS1 = WPS1Requirement[source]
weaver.processes.constants.CWL_REQUIREMENT_APP_TYPES[source]
weaver.processes.constants.CWL_REQUIREMENT_INIT_WORKDIR = InitialWorkDirRequirement[source]
weaver.processes.constants.PACKAGE_SIMPLE_TYPES[source]
weaver.processes.constants.PACKAGE_LITERAL_TYPES[source]
weaver.processes.constants.PACKAGE_COMPLEX_TYPES[source]
weaver.processes.constants.PACKAGE_ENUM_BASE = enum[source]
weaver.processes.constants.PACKAGE_CUSTOM_TYPES[source]
weaver.processes.constants.PACKAGE_ARRAY_BASE = array[source]
weaver.processes.constants.PACKAGE_ARRAY_MAX_SIZE[source]
weaver.processes.constants.PACKAGE_ARRAY_ITEMS[source]
weaver.processes.constants.PACKAGE_ARRAY_TYPES[source]
weaver.processes.constants.PACKAGE_TYPE_NULLABLE[source]
weaver.processes.constants.PACKAGE_SHORTCUTS[source]
weaver.processes.constants.PACKAGE_TYPE_POSSIBLE_VALUES[source]
weaver.processes.convert
Module Contents
weaver.processes.convert.WPS_Input_Type[source]
weaver.processes.convert.WPS_FIELD_MAPPING[source]
weaver.processes.convert.WPS_FIELD_FORMAT = ['formats', 'supported_formats', 'supported_values', 'default'][source]
weaver.processes.convert.WPS_COMPLEX_TYPES[source]
weaver.processes.convert.WPS_ALL_TYPES[source]
weaver.processes.convert.DEFAULT_FORMAT[source]
weaver.processes.convert.DEFAULT_FORMAT_MISSING = __DEFAULT_FORMAT_MISSING__[source]
weaver.processes.convert.LOGGER[source]
weaver.processes.convert.complex2json(data: Union[owslib.wps.ComplexData, Any])Union[weaver.typedefs.JSON, Any][source]

Obtains the JSON representation of a ComplexData or simply return the unmatched type.

weaver.processes.convert.metadata2json(meta: Union[ANY_Metadata_Type, Any], force: bool = False)Union[weaver.typedefs.JSON, Any][source]

Obtains the JSON representation of a OWS_Metadata or pywps.app.Common.Metadata. Otherwise, simply return the unmatched type. If requested, can enforce parsing a dictionary for the corresponding keys.

weaver.processes.convert.ows2json_field(ows_field: Union[owslib.wps.ComplexData, owslib.wps.Metadata, weaver.typedefs.AnyValueType])Union[weaver.typedefs.JSON, weaver.typedefs.AnyValueType][source]

Obtains the JSON or raw value from an owslib.wps I/O field.

weaver.processes.convert.ows2json_io(ows_io: OWS_IO_Type)JSON_IO_Type[source]

Converts I/O definition from owslib.wps to JSON.

weaver.processes.convert.ows2json_output_data(output: owslib.wps.Output, process_description: owslib.wps.Process, container: Optional[weaver.typedefs.AnySettingsContainer] = None)weaver.typedefs.JSON[source]

Utility method to convert an owslib.wps process execution output data (result) to JSON.

In the case that a reference output of JSON content-type is specified and that it refers to a file that contains an array list of URL references to simulate a multiple-output, this specific output gets expanded to contain both the original URL reference field and the loaded URL list under data field for easier access from the response body.

Referenced file(s) are fetched in order to store them locally if executed on a remote process, such that they can become accessible as local job result for following reporting or use by other processes in a workflow chain.

If the dataType details is missing from the data output (depending on servers that might omit it), the process_description is employed to retrieve the original description with expected result details.

Parameters
  • output – output with data value or reference according to expected result for the corresponding process.

  • process_description – definition of the process producing the specified output following execution.

  • container – container to retrieve application settings (for request options during file retrieval as needed).

Returns

converted JSON result data and additional metadata as applicable based on data-type and content-type.

weaver.processes.convert._get_multi_json_references(output: owslib.wps.Output, container: Optional[weaver.typedefs.AnySettingsContainer])Optional[List[weaver.typedefs.JSON]][source]

Since WPS standard does not allow to return multiple values for a single output, a lot of process actually return a JSON array containing references to these outputs.

Because the multi-output references are contained within this JSON file, it is not very convenient to retrieve the list of URLs as one always needs to open and read the file to get them. This function goal is to detect this particular format and expand the references to make them quickly available in the job output response.

Returns

Array of HTTP(S) references if the specified output is effectively a JSON containing that, None otherwise.

weaver.processes.convert.any2cwl_io(wps_io: Union[JSON_IO_Type, WPS_IO_Type, OWS_IO_Type], io_select: str)Tuple[CWL_IO_Type, Dict[str, str]][source]

Converts a WPS-like I/O to CWL corresponding I/O. Because of CWL I/O of type File with format field, the applicable namespace is also returned.

Returns

converted I/O and namespace dictionary with corresponding format references as required

weaver.processes.convert.wps2cwl_requirement(wps_service_url: Union[str, urllib.parse.ParseResult], wps_process_id: str)weaver.typedefs.JSON[source]

Obtains the CWL requirements definition needed for parsing by a remote WPS provider as an Application Package.

weaver.processes.convert.ows2json(wps_process: owslib.wps.Process, wps_service_name: str, wps_service_url: Union[str, urllib.parse.ParseResult])Tuple[weaver.typedefs.CWL, weaver.typedefs.JSON][source]

Generates the CWL package and process definitions from a owslib.wps.Process hosted under WPS location.

weaver.processes.convert.xml_wps2cwl(wps_process_response: requests.models.Response, settings: weaver.typedefs.AnySettingsContainer)Tuple[weaver.typedefs.CWL, weaver.typedefs.JSON][source]

Converts a WPS-1 ProcessDescription XML tree structure to an equivalent WPS-3 Process JSON and builds the associated CWL package in conformance to weaver.processes.wps_package.CWL_REQUIREMENT_APP_WPS1.

Parameters
  • wps_process_response – valid response (XML, 200) from a WPS-1 ProcessDescription.

  • settings – application settings to retrieve additional request options.

weaver.processes.convert.is_cwl_file_type(io_info: CWL_IO_Type)bool[source]

Identifies if the provided CWL input/output corresponds to one, many or potentially a File type(s).

When multiple distinct atomic types are allowed for a given I/O (e.g.: [string, File]) and that one of them is a File, the result will be True even if other types are not Files. Potential File when other base type is "null" will also return True.

weaver.processes.convert.is_cwl_array_type(io_info: CWL_IO_Type)Tuple[bool, str, pywps.validator.mode.MODE, Union[pywps.inout.literaltypes.AnyValue, List[Any]]][source]

Verifies if the specified I/O corresponds to one of various CWL array type definitions.

returns tuple(is_array, io_type, io_mode, io_allow) where:
  • is_array: specifies if the I/O is of array type.

  • io_type: array element type if is_array is True, type of io_info otherwise.

  • io_mode: validation mode to be applied if sub-element requires it, defaults to MODE.NONE.

  • io_allow: validation values to be applied if sub-element requires it, defaults to AnyValue.

Raises

PackageTypeError – if the array element doesn’t have the required values and valid format.

weaver.processes.convert.is_cwl_enum_type(io_info: CWL_IO_Type)Tuple[bool, str, int, Union[List[str], None]][source]

Verifies if the specified I/O corresponds to a CWL enum definition.

returns tuple(is_enum, io_type, io_allow) where:
  • is_enum: specifies if the I/O is of enum type.

  • io_type: enum base type if is_enum=True, type of io_info otherwise.

  • io_mode: validation mode to be applied if input requires it, defaults to MODE.NONE.

  • io_allow: validation values of the enum.

Raises

PackageTypeError – if the enum doesn’t have the required parameters and valid format.

weaver.processes.convert.cwl2wps_io(io_info: CWL_IO_Type, io_select: str)WPS_IO_Type[source]

Converts input/output parameters from CWL types to WPS types.

Parameters
  • io_info – parsed IO of a CWL file

  • io_selectWPS_INPUT or WPS_OUTPUT to specify desired WPS type conversion.

Returns

corresponding IO in WPS format

weaver.processes.convert.any2cwl_literal_datatype(io_type: str)Union[str, Type[weaver.utils.null]][source]

Solves common literal data-type names to supported ones for CWL.

weaver.processes.convert.any2wps_literal_datatype(io_type: weaver.typedefs.AnyValueType, is_value: bool)Union[str, Type[weaver.utils.null]][source]

Solves common literal data-type names to supported ones for WPS. Verification is accomplished by name when is_value=False, otherwise with python type when is_value=True.

weaver.processes.convert.json2wps_datatype(io_info: JSON_IO_Type)str[source]

Guesses the literal data-type from I/O JSON information in order to allow creation of the corresponding I/O WPS. Defaults to string if no suitable guess can be accomplished.

weaver.processes.convert.json2wps_field(field_info: JSON_IO_Type, field_category: str)Any[source]

Converts an I/O field from a JSON literal data, list, or dictionary to corresponding WPS types.

Parameters
  • field_info – literal data or information container describing the type to be generated.

  • field_category – one of WPS_FIELD_MAPPING keys to indicate how to parse field_info.

weaver.processes.convert.json2wps_io(io_info: JSON_IO_Type, io_select: str)WPS_IO_Type[source]

Converts an I/O from a JSON dict to PyWPS types.

Parameters
  • io_info – I/O in JSON dict format.

  • io_selectWPS_INPUT or WPS_OUTPUT to specify desired WPS type conversion.

Returns

corresponding I/O in WPS format.

weaver.processes.convert.wps2json_io(io_wps: WPS_IO_Type)JSON_IO_Type[source]

Converts a PyWPS I/O into a dictionary based version with keys corresponding to standard names (WPS 2.0).

weaver.processes.convert.wps2json_job_payload(wps_request: pywps.app.WPSRequest, wps_process: pywps.Process)weaver.typedefs.JSON[source]

Converts the input and output values of a pywps WPS Execute request to corresponding WPS-REST job.

The inputs and outputs must be parsed from XML POST payload or KVP GET query parameters, and converted to data container defined by pywps based on the process definition.

weaver.processes.convert.get_field(io_object: Any, field: str, search_variations: bool = False, pop_found: bool = False, default: Any = null)Any[source]

Gets a field by name from various I/O object types.

Default value is null used for most situations to differentiate from literal None which is often used as default for parameters. The NullType allows to explicitly tell that there was ‘no field’ and not ‘no value’ in existing field. If you provided another value, it will be returned if not found within the input object.

Returns

matched value (including search variations if enabled), or default.

weaver.processes.convert.set_field(io_object: Union[ANY_IO_Type, ANY_Format_Type], field: str, value: Any, force: bool = False)None[source]

Sets a field by name into various I/O object types. Field value is set only if not null to avoid inserting data considered invalid. If force=True, verification of null value is ignored.

weaver.processes.convert._are_different_and_set(item1: Any, item2: Any)bool[source]

Compares two value representations and returns True only if both are not null, are of same type and of different representative value. By “representative”, we consider here the visual representation of byte/unicode strings to support XML/JSON and Python 2/3 implementations. Other non string-like types are verified with literal (usual) equality method.

weaver.processes.convert.is_equal_formats(format1: Union[pywps.inout.formats.Format, weaver.typedefs.JSON], format2: Union[pywps.inout.formats.Format, weaver.typedefs.JSON])bool[source]

Verifies for matching formats.

weaver.processes.convert.merge_io_formats(wps_formats: List[ANY_Format_Type], cwl_formats: List[ANY_Format_Type])List[ANY_Format_Type][source]

Merges I/O format definitions by matching mime-type field. In case of conflict, preserve the WPS version which can be more detailed (for example, by specifying encoding).

Verifies if DEFAULT_FORMAT_MISSING was written to a single CWL format caused by a lack of any value provided as input. In this case, only WPS formats are kept.

In the event that DEFAULT_FORMAT_MISSING was written to the CWL formats and that no WPS format was specified, the DEFAULT_FORMAT is returned.

Raises

PackageTypeError – if inputs are invalid format lists

weaver.processes.convert.merge_package_io(wps_io_list: List[ANY_IO_Type], cwl_io_list: List[WPS_IO_Type], io_select: str)List[WPS_IO_Type][source]

Update I/O definitions to use for process creation and returned by GetCapabilities, DescribeProcess. If WPS I/O definitions where provided during deployment, update CWL-to-WPS converted I/O with the WPS I/O complementary details. Otherwise, provide minimum field requirements that can be retrieved from CWL definitions.

Removes any deployment WPS I/O definitions that don’t match any CWL I/O by ID. Adds missing deployment WPS I/O definitions using expected CWL I/O IDs.

Parameters
  • wps_io_list – list of WPS I/O (as json) passed during process deployment.

  • cwl_io_list – list of CWL I/O converted to WPS-like I/O for counter-validation.

  • io_selectWPS_INPUT or WPS_OUTPUT to specify desired WPS type conversion.

Returns

list of validated/updated WPS I/O for the process matching CWL I/O requirements.

weaver.processes.convert.transform_json(json_data: ANY_IO_Type, rename: Optional[Dict[weaver.typedefs.AnyKey, Any]] = None, remove: Optional[List[weaver.typedefs.AnyKey]] = None, add: Optional[Dict[weaver.typedefs.AnyKey, Any]] = None, replace_values: Optional[Dict[weaver.typedefs.AnyKey, Any]] = None, replace_func: Optional[Dict[weaver.typedefs.AnyKey, Callable[[Any], Any]]] = None)ANY_IO_Type[source]

Transforms the input json_data with different methods. The transformations are applied in the same order as the arguments.

weaver.processes.esgf_process
Module Contents
weaver.processes.esgf_process.LAST_PERCENT_REGEX[source]
class weaver.processes.esgf_process.Percent[source]
PREPARING = 2[source]
SENDING = 3[source]
COMPUTE_DONE = 98[source]
FINISHED = 100[source]
class weaver.processes.esgf_process.InputNames[source]
FILES = files[source]
VARIABLE = variable[source]
API_KEY = api_key[source]
TIME = time[source]
LAT = lat[source]
LON = lon[source]
class weaver.processes.esgf_process.InputArguments[source]
START = start[source]
END = end[source]
CRS = crs[source]
class weaver.processes.esgf_process.ESGFProcess(provider: str, process: str, request: pywps.app.WPSRequest, update_status: weaver.typedefs.UpdateStatusPartialFunction)[source]

Common interface for WpsProcess to be used in CWL jobs.

required_inputs[source]
execute(self: weaver.typedefs.JSON, workflow_inputs: str, out_dir: Dict[str, str], expected_outputs)None[source]

Execute an ESGF process from cwl inputs

_prepare_inputs(self: weaver.typedefs.JSON, workflow_inputs)List[cwt.Variable][source]

Convert inputs from cwl inputs to ESGF format

static _get_domain(workflow_inputs: weaver.typedefs.JSON)Optional[cwt.Domain][source]
_check_required_inputs(self, workflow_inputs)[source]
static _get_files_urls(workflow_inputs: weaver.typedefs.JSON)List[Tuple[str, str]][source]

Get all netcdf files from the cwl inputs

static _get_variable(workflow_inputs: weaver.typedefs.JSON)str[source]

Get all netcdf files from the cwl inputs

_run_process(self: str, api_key: List[cwt.Variable], inputs: Optional[cwt.Domain], domain=None)cwt.Process[source]

Run an ESGF process

_wait(self: cwt.Process, esgf_process: float, sleep_time=2)bool[source]

Wait for an ESGF process to finish, while reporting its status

_process_results(self: cwt.Process, esgf_process: str, output_dir: Dict[str, str], expected_outputs)None[source]

Process the result of the execution

_write_outputs(self, url, output_dir, expected_outputs)[source]

Write the output netcdf url to a local drive

weaver.processes.execution
Module Contents
weaver.processes.execution.LOGGER[source]
weaver.processes.execution.JOB_PROGRESS_SETUP = 1[source]
weaver.processes.execution.JOB_PROGRESS_DESCRIBE = 2[source]
weaver.processes.execution.JOB_PROGRESS_GET_INPUTS = 3[source]
weaver.processes.execution.JOB_PROGRESS_GET_OUTPUTS = 4[source]
weaver.processes.execution.JOB_PROGRESS_EXECUTE_REQUEST = 5[source]
weaver.processes.execution.JOB_PROGRESS_EXECUTE_STATUS_LOCATION = 6[source]
weaver.processes.execution.JOB_PROGRESS_EXECUTE_MONITOR_START = 7[source]
weaver.processes.execution.JOB_PROGRESS_EXECUTE_MONITOR_LOOP = 8[source]
weaver.processes.execution.JOB_PROGRESS_EXECUTE_MONITOR_DONE = 96[source]
weaver.processes.execution.JOB_PROGRESS_EXECUTE_MONITOR_ERROR = 97[source]
weaver.processes.execution.JOB_PROGRESS_EXECUTE_MONITOR_END = 98[source]
weaver.processes.execution.JOB_PROGRESS_NOTIFY = 99[source]
weaver.processes.execution.JOB_PROGRESS_DONE = 100[source]
weaver.processes.execution.execute_process(self, job_id, url, headers=None)[source]
weaver.processes.execution.make_results_relative(results: List[weaver.typedefs.JSON], settings: weaver.typedefs.SettingsType)List[weaver.typedefs.JSON][source]

Redefines job results to be saved in database as relative paths to output directory configured in PyWPS (i.e.: relative to weaver.wps_output_dir).

This allows us to easily adjust the exposed result HTTP path according to server configuration (i.e.: relative to weaver.wps_output_path and/or weaver.wps_output_url) and it also avoid rewriting the whole database job results if the setting is changed later on.

weaver.processes.execution.map_locations(job: weaver.datatype.Job, settings: weaver.typedefs.SettingsType)None[source]

Generates symlink references from the Job UUID to PyWPS UUID results (outputs directory, status and log locations). Update the Job’s WPS ID if applicable (job executed locally). Assumes that all results are located under the same reference UUID.

weaver.processes.execution.submit_job(request: pyramid.request.Request, reference: Union[weaver.datatype.Service, weaver.datatype.Process], tags: Optional[List[str]] = None)weaver.typedefs.JSON[source]

Generates the job submission from details retrieved in the request.

See also

submit_job_handler() to provide elements pre-extracted from requests or from other parsing.

weaver.processes.execution._validate_job_parameters(json_body)[source]

Tests supported parameters not automatically validated by colander deserialize.

weaver.processes.execution.submit_job_handler(payload: weaver.typedefs.JSON, settings: weaver.typedefs.SettingsType, service_url: str, provider_id: Optional[str] = None, process_id: str = None, is_workflow: bool = False, is_local: bool = True, visibility: Optional[str] = None, language: Optional[str] = None, auth: Optional[weaver.typedefs.HeaderCookiesType] = None, tags: Optional[List[str]] = None, user: Optional[int] = None)weaver.typedefs.JSON[source]

Submits the job to the Celery worker with provided parameters.

Assumes that parameters have been pre-fetched and validated, except for the input payload.

weaver.processes.opensearch
Module Contents
weaver.processes.opensearch.LOGGER[source]
weaver.processes.opensearch.alter_payload_after_query(payload)[source]

When redeploying the package on ADES, strip out any EOImage parameter

Parameters

payload

weaver.processes.opensearch.validate_bbox(bbox)[source]
weaver.processes.opensearch.query_eo_images_from_wps_inputs(wps_inputs: Dict[str, Deque], eoimage_source_info: Dict[str, Dict], accept_mime_types: Dict[str, List[str]], settings: Optional[weaver.typedefs.AnySettingsContainer] = None)Dict[str, Deque][source]

Query OpenSearch using parameters in inputs and return file links.

eoimage_ids is used to identify if a certain input is an eoimage.

Parameters
  • wps_inputs – inputs containing info to query

  • eoimage_source_info – data source info of eoimages

  • accept_mime_types – dict of list of accepted mime types, ordered by preference

  • settings – application settings to retrieve request options as necessary.

weaver.processes.opensearch.replace_with_opensearch_scheme(link)[source]
Parameters

link – url to replace scheme

weaver.processes.opensearch.load_wkt(wkt)[source]
Parameters

wkt (string) – to get the bounding box of

class weaver.processes.opensearch.OpenSearchQuery(collection_identifier: str, osdd_url: str, catalog_search_field: str = 'parentIdentifier', settings: Optional[weaver.typedefs.AnySettingsContainer] = None)[source]
Parameters
  • collection_identifier – Collection ID to query

  • osdd_url – Global OSDD url for opensearch queries.

  • catalog_search_field – Name of the field for the collection identifier.

  • settings – application settings to retrieve request options as necessary.

DEFAULT_MAX_QUERY_RESULTS = 5[source]
get_template_url(self)[source]
_prepare_query_url(self: str, template_url: Dict, params)Tuple[str, Dict][source]
Parameters
  • template_url – url containing query parameters

  • params – parameters to insert in formatted url

_query_features_paginated(self: Dict, params)Iterable[Dict, str][source]
Parameters

params – query parameters

query_datasets(self: Dict, params: Tuple, accept_schemes: List, accept_mime_types)Iterable[str][source]

Loop on every opensearch result feature and yield url matching required mime-type and scheme. Log a warning if a feature cannot yield a valid url (either no compatible mime-type or scheme)

Parameters
  • params – query parameters

  • accept_schemes – only return links of this scheme

  • accept_mime_types – list of accepted mime types, ordered by preference

Raises

KeyError – If the feature doesn’t contain a json data section or an atom alternative link

weaver.processes.opensearch.get_additional_parameters(input_data: Dict)List[Tuple[str, str]][source]
Parameters

input_data – Dict containing or not the “additionalParameters” key

class weaver.processes.opensearch.EOImageDescribeProcessHandler(: List[Dict], inputs)[source]
static is_eoimage_input(input_data: Dict)bool[source]
static get_allowed_collections(input_data: Dict)List[source]
static make_aoi(id_)[source]
static make_collection(identifier, allowed_values)[source]
static make_toi(id_, start_date=True)[source]
Parameters
  • id

  • start_date – (Default value = True)

to_opensearch(self: bool, unique_aoi: bool, unique_toi)List[Dict][source]
Parameters
  • unique_aoi

  • unique_toi

weaver.processes.opensearch.get_eo_images_inputs_from_payload(payload)[source]
Parameters

payload

weaver.processes.opensearch.get_original_collection_id(payload: Dict, wps_inputs: Dict[str, collections.deque])Dict[str, collections.deque][source]

When we deploy a Process that contains OpenSearch parameters, the collection identifier is modified. Ex: files -> collection Ex: s2 -> collection_s2, probav -> collection_probav This function changes the id in the execute request to the one in the deploy description. :param payload: :param wps_inputs: :return:

weaver.processes.opensearch.get_eo_images_data_sources(payload: Dict, wps_inputs: Dict[str, collections.deque])Dict[str, Dict][source]
Parameters
  • payload – Deploy payload

  • wps_inputs – Execute inputs

weaver.processes.opensearch.get_eo_images_mime_types(payload: Dict)Dict[str, List][source]

From the deploy payload, get the accepted mime types. :param payload: Deploy payload

weaver.processes.opensearch.insert_max_occurs(payload: Dict, wps_inputs: Dict[str, Deque])None[source]

Insert maxOccurs value in wps inputs using the deploy payload. :param payload: Deploy payload :param wps_inputs: WPS inputs

weaver.processes.opensearch.modified_collection_identifiers(eo_image_identifiers)[source]
weaver.processes.opensearch.get_data_source(collection_id)[source]
weaver.processes.opensearch.get_eo_images_ids_from_payload(payload)[source]
weaver.processes.opensearch.replace_inputs_describe_process(inputs: List[Dict], payload: Dict)List[Dict][source]

Replace EOImage inputs (if additionalParameter -> EOImage -> true) with OpenSearch query parameters.

weaver.processes.opensearch._make_specific_identifier(param_name, identifier)[source]

Only adds an underscore between the parameters.

weaver.processes.sources
Module Contents
weaver.processes.sources.DATA_SOURCES[source]

Data sources configuration.

Unless explicitly overridden, the configuration will be loaded from file as specified by``weaver.data_sources`` setting. Following JSON schema format is expected (corresponding YAML also supported):

{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "title": "Data Sources",
  "type": "object",
  "patternProperties": {
    ".*": {
      "type": "object",
      "required": [ "netloc", "ades" ],
      "additionalProperties": false,
      "properties": {
        "netloc": {
          "type": "string",
          "description": "Net location of a data source url use to match this data source."
        },
        "ades": {
          "type": "string",
          "description": "ADES endpoint where the processing of this data source can occur."
        },
        "default": {
          "type": "string",
          "description": "True indicate that if no data source match this one should be used (Use the first default)."
        }
      }
    }
  }
}
weaver.processes.sources.fetch_data_sources()[source]
weaver.processes.sources.get_default_data_source(data_sources)[source]
weaver.processes.sources.retrieve_data_source_url(data_source: Optional[Text])Text[source]

Finds the data source URL using the provided data source identifier.

Returns

found URL, ‘default’ data source if not found, or current weaver WPS Rest API base URL if None.

weaver.processes.sources.get_data_source_from_url(data_url)[source]
weaver.processes.types
Module Contents
weaver.processes.types.PROCESS_APPLICATION = application[source]
weaver.processes.types.PROCESS_BUILTIN = builtin[source]
weaver.processes.types.PROCESS_TEST = test[source]
weaver.processes.types.PROCESS_WORKFLOW = workflow[source]
weaver.processes.types.PROCESS_WPS_LOCAL = wps[source]
weaver.processes.types.PROCESS_WPS_REMOTE = wps-remote[source]
weaver.processes.utils
Module Contents
weaver.processes.utils.LOGGER[source]
weaver.processes.utils.get_process(process_id: Optional[str] = None, request: Optional[pyramid.request.Request] = None, settings: Optional[weaver.typedefs.SettingsType] = None, store: Optional[weaver.store.base.StoreProcesses] = None)weaver.datatype.Process[source]

Obtain the specified process and validate information, returning appropriate HTTP error if invalid.

Process identifier must be provided from either the request path definition or literal ID. Database must be retrievable from either the request, underlying settings, or direct store reference.

Different parameter combinations are intended to be used as needed or more appropriate, such that redundant operations can be reduced where some objects are already fetched from previous operations.

weaver.processes.utils.get_job_submission_response(body: weaver.typedefs.JSON)pyramid.httpexceptions.HTTPCreated[source]

Generates the successful response from contents returned by job submission process.

weaver.processes.utils.map_progress(progress: weaver.typedefs.Number, range_min: weaver.typedefs.Number, range_max: weaver.typedefs.Number)weaver.typedefs.Number[source]

Calculates the relative progression of the percentage process within min/max values.

weaver.processes.utils._check_deploy(payload)[source]

Validate minimum deploy payload field requirements with exception handling.

weaver.processes.utils._get_deploy_process_info(process_info, reference, package)[source]

Obtain the process definition from deploy payload with exception handling.

weaver.processes.utils.deploy_process_from_payload(payload: weaver.typedefs.JSON, container: weaver.typedefs.AnyContainer, overwrite: bool = False)pyramid.httpexceptions.HTTPException[source]

Adds a weaver.datatype.Process instance to storage using the provided JSON payload matching weaver.wps_restapi.swagger_definitions.ProcessDescription.

Parameters
  • payload – JSON payload that was specified during the process deployment request.

  • container – container to retrieve application settings.

  • overwrite – whether to allow override of an existing process definition if conflict occurs.

Returns

HTTPOk if the process registration was successful.

Raises

HTTPException – for any invalid process deployment step.

weaver.processes.utils.parse_wps_process_config(config_entry: Union[weaver.typedefs.JSON, str])Tuple[str, str, List[str], bool][source]

Parses the available WPS provider or process entry to retrieve its relevant information.

Returns

WPS provider name, WPS service URL, and list of process identifier(s).

Raises

ValueError – if the entry cannot be parsed correctly.

weaver.processes.utils.register_wps_processes_from_config(wps_processes_file_path: Optional[weaver.typedefs.FileSystemPathType], container: weaver.typedefs.AnySettingsContainer)None[source]

Loads a wps_processes.yml file and registers WPS-1 providers processes to the current Weaver instance as equivalent WPS-2 processes.

References listed under processes are registered. When the reference is a service (provider), registration of each WPS process is done individually for each of the specified providers with ID [service]_[process] per listed process by GetCapabilities.

New in version 1.14.0: When references are specified using providers section instead of processes, the registration only saves the remote WPS provider endpoint to dynamically populate WPS processes on demand.

See also

  • weaver.wps_processes.yml.example for additional file format details

weaver.processes.wps1_process
Module Contents
weaver.processes.wps1_process.LOGGER[source]
weaver.processes.wps1_process.REMOTE_JOB_PROGRESS_REQ_PREP = 2[source]
weaver.processes.wps1_process.REMOTE_JOB_PROGRESS_EXECUTION = 5[source]
weaver.processes.wps1_process.REMOTE_JOB_PROGRESS_MONITORING = 10[source]
weaver.processes.wps1_process.REMOTE_JOB_PROGRESS_FETCH_OUT = 90[source]
weaver.processes.wps1_process.REMOTE_JOB_PROGRESS_COMPLETED = 100[source]
class weaver.processes.wps1_process.Wps1Process(provider: str, process: str, request: pywps.app.WPSRequest, update_status: weaver.typedefs.UpdateStatusPartialFunction)[source]

Common interface for WpsProcess to be used in CWL jobs.

execute(self, workflow_inputs, out_dir, expected_outputs)[source]

Execute a remote process using the given inputs. The function is expected to monitor the process and update the status. Retrieve the expected outputs and store them in the out_dir.

Parameters
  • workflow_inputsCWL job dict

  • out_dir – directory where the outputs must be written

  • expected_outputs – expected value outputs as {‘id’: ‘value’}

weaver.processes.wps3_process
Module Contents
weaver.processes.wps3_process.LOGGER[source]
weaver.processes.wps3_process.REMOTE_JOB_PROGRESS_PROVIDER = 1[source]
weaver.processes.wps3_process.REMOTE_JOB_PROGRESS_DEPLOY = 2[source]
weaver.processes.wps3_process.REMOTE_JOB_PROGRESS_VISIBLE = 3[source]
weaver.processes.wps3_process.REMOTE_JOB_PROGRESS_REQ_PREP = 5[source]
weaver.processes.wps3_process.REMOTE_JOB_PROGRESS_EXECUTION = 9[source]
weaver.processes.wps3_process.REMOTE_JOB_PROGRESS_MONITORING = 10[source]
weaver.processes.wps3_process.REMOTE_JOB_PROGRESS_FETCH_OUT = 90[source]
weaver.processes.wps3_process.REMOTE_JOB_PROGRESS_COMPLETED = 100[source]
class weaver.processes.wps3_process.Wps3Process(step_payload: weaver.typedefs.JSON, joborder: weaver.typedefs.JSON, process: str, request: pywps.app.WPSRequest, update_status: weaver.typedefs.UpdateStatusPartialFunction)[source]

Common interface for WpsProcess to be used in CWL jobs.

resolve_data_source(self, step_payload, joborder)[source]
get_user_auth_header(self)[source]
is_deployed(self)[source]
is_visible(self)Union[bool, None][source]

Gets the process visibility.

Returns

True/False correspondingly for public/private if visibility is retrievable, False if authorized access but process cannot be found, None if forbidden access.

set_visibility(self, visibility)[source]
describe_process(self)[source]
deploy(self)[source]
execute(self, workflow_inputs, out_dir, expected_outputs)[source]

Execute a remote process using the given inputs. The function is expected to monitor the process and update the status. Retrieve the expected outputs and store them in the out_dir.

Parameters
  • workflow_inputsCWL job dict

  • out_dir – directory where the outputs must be written

  • expected_outputs – expected value outputs as {‘id’: ‘value’}

get_job_status(self, job_status_uri, retry=True)[source]
get_job_results(self, job_id)[source]
weaver.processes.wps_default
Module Contents
weaver.processes.wps_default.LOGGER[source]
class weaver.processes.wps_default.HelloWPS(*_, **__)[source]
Parameters
  • handler – A callable that gets invoked for each incoming request. It should accept a single pywps.app.WPSRequest argument and return a pywps.app.WPSResponse object.

  • identifier (string) – Name of this process.

  • title (string) – Human readable title of process.

  • abstract (string) – Brief narrative description of the process.

  • keywords (list) – Keywords that characterize a process.

  • inputs – List of inputs accepted by this process. They should be LiteralInput and ComplexInput and BoundingBoxInput objects.

  • outputs – List of outputs returned by this process. They should be LiteralOutput and ComplexOutput and BoundingBoxOutput objects.

  • metadata – List of metadata advertised by this process. They should be pywps.app.Common.Metadata objects.

  • translations (dict[str,dict[str,str]]) – The first key is the RFC 4646 language code, and the nested mapping contains translated strings accessible by a string property. e.g. {“fr-CA”: {“title”: “Mon titre”, “abstract”: “Une description”}}

identifier = hello[source]
title = Say Hello[source]
type[source]
_handler(self, request, response)[source]
weaver.processes.wps_package

Functions and classes that offer interoperability and conversion between corresponding elements defined as CWL CommandLineTool/Workflow and WPS ProcessDescription in order to generate ADES/EMS Application Package.

Module Contents
weaver.processes.wps_package.CWLRequirement[source]
weaver.processes.wps_package.LOGGER[source]
weaver.processes.wps_package.PACKAGE_DEFAULT_FILE_NAME = package[source]
weaver.processes.wps_package.PACKAGE_EXTENSIONS[source]
weaver.processes.wps_package.PACKAGE_OUTPUT_HOOK_LOG_UUID = PACKAGE_OUTPUT_HOOK_LOG_{}[source]
weaver.processes.wps_package.PACKAGE_PROGRESS_PREP_LOG = 1[source]
weaver.processes.wps_package.PACKAGE_PROGRESS_LAUNCHING = 2[source]
weaver.processes.wps_package.PACKAGE_PROGRESS_LOADING = 5[source]
weaver.processes.wps_package.PACKAGE_PROGRESS_GET_INPUT = 6[source]
weaver.processes.wps_package.PACKAGE_PROGRESS_ADD_EO_IMAGES = 7[source]
weaver.processes.wps_package.PACKAGE_PROGRESS_CONVERT_INPUT = 8[source]
weaver.processes.wps_package.PACKAGE_PROGRESS_CWL_RUN = 10[source]
weaver.processes.wps_package.PACKAGE_PROGRESS_CWL_DONE = 95[source]
weaver.processes.wps_package.PACKAGE_PROGRESS_PREP_OUT = 98[source]
weaver.processes.wps_package.PACKAGE_PROGRESS_DONE = 100[source]
weaver.processes.wps_package.get_status_location_log_path(status_location: str, out_dir: Optional[str] = None)str[source]
weaver.processes.wps_package.retrieve_package_job_log(execution: owslib.wps.WPSExecution, job: weaver.datatype.Job, progress_min: weaver.typedefs.Number = 0, progress_max: weaver.typedefs.Number = 100)None[source]

Obtains the underlying WPS execution log from the status file to add them after existing job log entries.

weaver.processes.wps_package.get_process_location(process_id_or_url: Union[Dict[str, Any], str], data_source: Optional[str] = None)str[source]

Obtains the URL of a WPS REST DescribeProcess given the specified information.

Parameters
  • process_id_or_url – process “identifier” or literal URL to DescribeProcess WPS-REST location.

  • data_source – identifier of the data source to map to specific ADES, or map to localhost if None.

Returns

URL of EMS or ADES WPS-REST DescribeProcess.

weaver.processes.wps_package.get_package_workflow_steps(package_dict_or_url: Union[Dict[str, Any], str])List[Dict[str, str]][source]
Parameters

package_dict_or_url – process package definition or literal URL to DescribeProcess WPS-REST location.

Returns

list of workflow steps as {“name”: <name>, “reference”: <reference>} where name is the generic package step name, and reference is the id/url of a registered WPS package.

weaver.processes.wps_package._fetch_process_info(process_info_url: str, fetch_error: Type[Exception])weaver.typedefs.JSON[source]

Fetches the JSON process information from the specified URL and validates that it contains something.

Raises

fetch_error – provided exception with URL message if the process information could not be retrieved.

weaver.processes.wps_package._get_process_package(process_url: str)Tuple[weaver.typedefs.CWL, str][source]

Retrieves the WPS process package content from given process ID or literal URL.

Parameters

process_url – process literal URL to DescribeProcess WPS-REST location.

Returns

tuple of package body as dictionary and package reference name.

weaver.processes.wps_package._get_process_payload(process_url: str)weaver.typedefs.JSON[source]

Retrieves the WPS process payload content from given process ID or literal URL.

Parameters

process_url – process literal URL to DescribeProcess WPS-REST location.

Returns

payload body as dictionary.

weaver.processes.wps_package._get_package_type(package_dict: weaver.typedefs.CWL)Union[weaver.processes.types.PROCESS_APPLICATION, weaver.processes.types.PROCESS_WORKFLOW][source]
weaver.processes.wps_package._get_package_requirements_as_class_list(requirements: AnyCWLRequirements)ListCWLRequirements[source]

Converts CWL package requirements or hints sometime defined as Dict[<req>: {<params>}] to an explicit list of dictionary requirements with class key.

weaver.processes.wps_package._get_package_ordered_io(io_section: Union[List[weaver.typedefs.JSON], Dict[str, Union[weaver.typedefs.JSON, str]]], order_hints: Optional[List[weaver.typedefs.JSON]] = None)List[weaver.typedefs.JSON][source]

Converts CWL package I/O definitions defined as dictionary to an equivalent list representation. The list representation ensures that I/O order is preserved when written to file and reloaded afterwards regardless of each server and/or library’s implementation of dict container.

If this function fails to correctly order any I/O or cannot correctly guarantee such result because of the provided parameters (e.g.: no hints given when required), the result will not break nor change the final processing behaviour of the CWL engine. This is merely cosmetic adjustments to ease readability of I/O to avoid always shuffling their order across multiple application package reporting.

The important result of this function is to provide the CWL I/O as a consistent list of objects so it is less cumbersome to compare/merge/iterate over the elements with all functions that will follow.

Note

When defined as a dictionary, an OrderedDict is expected as input to ensure preserved field order. Prior to Python 3.7 or CPython 3.5, preserved order is not guaranteed for builtin dict. In this case the order_hints is required to ensure same order.

Parameters
  • io_section – Definition contained under the CWL inputs or outputs package fields.

  • order_hints – Optional/partial list of WPS I/O definitions hinting an order to sort CWL unsorted-dict I/O.

Returns

I/O specified as list of dictionary definitions with preserved order (as best as possible).

weaver.processes.wps_package._check_package_file(cwl_file_path_or_url: str)Tuple[str, bool][source]

Validates that the specified CWL file path or URL points to an existing and allowed file format.

Parameters

cwl_file_path_or_url – one of allowed file types path on disk, or an URL pointing to one served somewhere.

Returns

absolute_path, is_url: absolute path or URL, and boolean indicating if it is a remote URL file.

Raises

PackageRegistrationError – in case of missing file, invalid format or invalid HTTP status code.

weaver.processes.wps_package._load_package_file(file_path: str)weaver.typedefs.CWL[source]

Loads the package in YAML/JSON format specified by the file path.

weaver.processes.wps_package._load_package_content(package_dict: Dict, package_name: str = PACKAGE_DEFAULT_FILE_NAME, data_source: Optional[str] = None, only_dump_file: bool = False, tmp_dir: Optional[str] = None, loading_context: Optional[cwltool.context.LoadingContext] = None, runtime_context: Optional[cwltool.context.RuntimeContext] = None, process_offering: Optional[weaver.typedefs.JSON] = None)Optional[Tuple[cwltool.factory.Callable, str, Dict[str, str]]][source]

Loads the package content to file in a temporary directory. Recursively processes sub-packages steps if the parent is a Workflow (CWL class).

Parameters
  • package_dict – package content representation as a json dictionary.

  • package_name – name to use to create the package file.

  • data_source – identifier of the data source to map to specific ADES, or map to localhost if None.

  • only_dump_file – specify if the CWLFactoryCallable should be validated and returned.

  • tmp_dir – location of the temporary directory to dump files (deleted on exit).

  • loading_context – cwltool context used to create the cwl package (required if only_dump_file=False)

  • runtime_context – cwltool context used to execute the cwl package (required if only_dump_file=False)

  • process_offering – JSON body of the process description payload (used as I/O hint ordering)

Returns

if only_dump_file is True: None otherwise, tuple of:

  • instance of CWLFactoryCallable

  • package type (PROCESS_WORKFLOW or PROCESS_APPLICATION)

  • mapping of each step ID with their package name that must be run

Warning

Specified tmp_dir will be deleted on exit.

weaver.processes.wps_package._merge_package_inputs_outputs(wps_inputs_list: List[weaver.processes.convert.ANY_IO_Type], cwl_inputs_list: List[weaver.processes.convert.WPS_Input_Type], wps_outputs_list: List[weaver.processes.convert.ANY_IO_Type], cwl_outputs_list: List[weaver.processes.convert.WPS_Output_Type])Tuple[List[weaver.processes.convert.JSON_IO_Type], List[weaver.processes.convert.JSON_IO_Type]][source]

Merges I/O definitions to use for process creation and returned by GetCapabilities, DescribeProcess using the WPS specifications (from request POST) and CWL specifications (extracted from file).

Note:

parameters cwl_inputs_list and cwl_outputs_list are expected to be in WPS-like format (ie: CWL I/O converted to corresponding WPS I/O)

weaver.processes.wps_package._get_package_io(package_factory: cwltool.factory.Callable, io_select: str, as_json: bool)List[weaver.processes.convert.PKG_IO_Type][source]

Retrieves I/O definitions from a validated CWLFactoryCallable. Returned I/O format depends on value as_json.

weaver.processes.wps_package._get_package_inputs_outputs(package_factory: cwltool.factory.Callable, as_json: bool = False)Tuple[List[weaver.processes.convert.PKG_IO_Type], List[weaver.processes.convert.PKG_IO_Type]][source]

Generates WPS-like (inputs, outputs) tuple using parsed CWL package definitions.

weaver.processes.wps_package._update_package_metadata(wps_package_metadata: weaver.typedefs.JSON, cwl_package_package: weaver.typedefs.CWL)None[source]

Updates the package WPS metadata dictionary from extractable CWL package definition.

weaver.processes.wps_package._generate_process_with_cwl_from_reference(reference: str)Tuple[weaver.typedefs.CWL, weaver.typedefs.JSON][source]

Resolves the reference type (CWL, WPS-1, WPS-2, WPS-3) and generates a CWL package from it. Additionally provides minimal process details retrieved from the reference.

weaver.processes.wps_package.get_process_definition(process_offering: weaver.typedefs.JSON, reference: Optional[str] = None, package: Optional[weaver.typedefs.CWL] = None, data_source: Optional[str] = None)weaver.typedefs.JSON[source]

Returns an updated process definition dictionary ready for storage using provided WPS process_offering and a package definition passed by reference or package CWL content. The returned process information can be used later on to load an instance of weaver.wps_package.WpsPackage.

Parameters
  • process_offeringWPS REST-API (WPS-3) process offering as JSON.

  • reference – URL to CWL package definition, WPS-1 DescribeProcess endpoint or WPS-3 Process endpoint.

  • package – literal CWL package definition (YAML or JSON format).

  • data_source – where to resolve process IDs (default: localhost if None).

Returns

updated process definition with resolved/merged information from package/reference.

class weaver.processes.wps_package.WpsPackage(**kw)[source]
Parameters
  • handler – A callable that gets invoked for each incoming request. It should accept a single pywps.app.WPSRequest argument and return a pywps.app.WPSResponse object.

  • identifier (string) – Name of this process.

  • title (string) – Human readable title of process.

  • abstract (string) – Brief narrative description of the process.

  • keywords (list) – Keywords that characterize a process.

  • inputs – List of inputs accepted by this process. They should be LiteralInput and ComplexInput and BoundingBoxInput objects.

  • outputs – List of outputs returned by this process. They should be LiteralOutput and ComplexOutput and BoundingBoxOutput objects.

  • metadata – List of metadata advertised by this process. They should be pywps.app.Common.Metadata objects.

  • translations (dict[str,dict[str,str]]) – The first key is the RFC 4646 language code, and the nested mapping contains translated strings accessible by a string property. e.g. {“fr-CA”: {“title”: “Mon titre”, “abstract”: “Une description”}}

Creates a WPS-3 Process instance to execute a CWL application package definition.

Process parameters should be loaded from an existing weaver.datatype.Process instance generated using weaver.wps_package.get_process_definition().

Provided kw should correspond to weaver.datatype.Process.params_wps()

package :Optional[weaver.typedefs.CWL][source]
package_id :Optional[str][source]
package_type :Optional[str][source]
package_log_hook_stderr :Optional[str][source]
package_log_hook_stdout :Optional[str][source]
percent :Optional[weaver.typedefs.Number][source]
remote_execution :Optional[bool][source]
log_file :Optional[str][source]
log_level :Optional[int][source]
logger :Optional[logging.Logger][source]
step_packages :Optional[List[weaver.typedefs.CWL]][source]
step_launched :Optional[List[str]][source]
request :Optional[pywps.app.WPSRequest][source]
response :Optional[pywps.response.execute.ExecuteResponse][source]
setup_loggers(self: bool, log_stdout_stderr=True)None[source]

Configures useful loggers to catch most of the common output and/or error messages during package execution.

insert_package_log(self: Union[CWLResults, cwltool.factory.WorkflowStatus], result)List[str][source]

Retrieves additional CWL sub-process logs captures to retrieve internal application output and/or errors.

After execution of this method, the WPS output log (which can be obtained by retrieve_package_job_log()) will have additional stderr/stdout entries extracted from the underlying application package tool execution.

The outputs and errors are inserted as best as possible in the logical order to make reading of the merged logs appear as a natural and chronological order. In the event that both output and errors are available, they are appended one after another as merging in an orderly fashion cannot be guaranteed by outside CWL runner.

Note

In case of any exception, log reporting is aborted and ignored.

Todo

Improve for realtime updates when using async routine (https://github.com/crim-ca/weaver/issues/131)

Parameters

result – output results returned by successful CWL package instance execution or raised CWL exception.

Returns

captured execution log lines retrieved from files

update_requirements(self)[source]

Inplace modification of package to adjust invalid items that would break behaviour we must enforce.

update_effective_user(self)[source]

Update effective user/group for the Application Package to be executed.

FIXME: (experimental) update user/group permissions

Reducing permissions is safer inside docker application since weaver/cwltool could be running as root but this requires that mounted volumes have the required permissions so euid:egid can use them.

Overrides cwltool’s function to retrieve user/group id for ones we enforce.

update_status(self: str, message: weaver.typedefs.Number, progress: weaver.status.AnyStatusType, status)None[source]

Updates the PyWPS real job status from a specified parameters.

step_update_status(self: str, message: weaver.typedefs.Number, progress: weaver.typedefs.Number, start_step_progress: weaver.typedefs.Number, end_step_progress: str, step_name: pywps.inout.literaltypes.AnyValue, target_host: str, status)None[source]
log_message(self: weaver.status.AnyStatusType, status: str, message: Optional[weaver.typedefs.Number], progress: int = None, level=logging.INFO)None[source]
exception_message(self: Type[Exception], exception_type: Optional[Exception], exception: str = None, message: weaver.status.AnyStatusType = 'no message', status: int = STATUS_EXCEPTION, level=logging.ERROR)Exception[source]

Logs to the job the specified error message with the provided exception type.

Returns

formatted exception with message to be raised by calling function.

classmethod map_step_progress(cls: int, step_index: int, steps_total)weaver.typedefs.Number[source]

Calculates the percentage progression of a single step of the full process.

Note

The step procession is adjusted according to delimited start/end of the underlying CWL execution to provide a continuous progress percentage over the complete execution. Otherwise, we would have values that jump around according to whichever progress the underlying remote WPS or monitored CWL employs, if any is provided.

_handler(self: pywps.app.WPSRequest, request: pywps.response.execute.ExecuteResponse, response)pywps.response.execute.ExecuteResponse[source]

Method called when process receives the WPS execution request.

must_fetch(self: str, input_ref)bool[source]

Figures out if file reference should be fetched immediately for local execution. If anything else than local script/docker, remote ADES/WPS process will fetch it. S3 are handled here to avoid error on remote WPS not supporting it.

make_inputs(self, wps_inputs: Dict[str, Deque[weaver.processes.convert.WPS_Input_Type]], cwl_inputs_info: Dict[str, weaver.processes.convert.CWL_Input_Type])Dict[str, weaver.typedefs.ValueType][source]

Converts WPS input values to corresponding CWL input values for processing by CWL package instance.

The WPS inputs must correspond to pywps definitions. Multiple values are adapted to arrays as needed. WPS Complex types (files) are converted to appropriate locations based on data or reference specification.

Parameters
  • wps_inputs – actual WPS inputs parsed from execution request

  • cwl_inputs_info – expected CWL input definitions for mapping

Returns

CWL input values

make_location_input(self: str, input_type: pywps.inout.ComplexInput, input_definition)weaver.typedefs.JSON[source]

Generates the JSON content required to specify a CWL File input definition from a location.

Note

If the process requires OpenSearch references that should be preserved as is, use scheme defined by weaver.processes.constants.OPENSEARCH_LOCAL_FILE_SCHEME prefix instead of http(s)://.

make_outputs(self: CWLResults, cwl_result)None[source]

Maps CWL result outputs to corresponding WPS outputs.

make_location_output(self: CWLResults, cwl_result: str, output_id)None[source]

Rewrite the WPS output with required location using result path from CWL execution.

Configures the parameters such that PyWPS will either auto-resolve the local paths to match with URL defined by weaver.wps_output_url or upload it to S3 bucket from weaver.wps_output_s3_bucket and provide reference directly.

See also

  • weaver.wps.load_pywps_config()

make_tool(self: weaver.typedefs.ToolPathObjectType, toolpath_object: cwltool.context.LoadingContext, loading_context)cwltool.process.Process[source]
get_application_requirement(self)Dict[str, Any][source]

Obtains the first item in CWL package requirements or hints that corresponds to a Weaver-specific application type as defined in CWL_REQUIREMENT_APP_TYPES.

Returns

dictionary that minimally has class field, and optionally other parameters from that requirement.

get_job_process_definition(self: str, jobname: weaver.typedefs.JSON, joborder: weaver.typedefs.CWL, tool)WpsPackage[source]

This function is called before running an ADES job (either from a workflow step or a simple EMS dispatch). It must return a weaver.processes.wps_process.WpsProcess instance configured with the proper CWL package definition, ADES target and cookies to access it (if protected).

Parameters
  • jobname – The workflow step or the package id that must be launched on an ADES string

  • joborder – The params for the job dict {input_name: input_value} input_value is one of input_object or array [input_object] input_object is one of string or dict {class: File, location: string} in our case input are expected to be File object

  • tool – Whole CWL config including hints requirement (see: weaver.processes.constants.CWL_REQUIREMENT_APP_TYPES)

weaver.processes.wps_process_base
Module Contents
class weaver.processes.wps_process_base.WpsProcessInterface(: pywps.app.WPSRequest, request)[source]

Common interface for WpsProcess to be used in CWL jobs.

abstract execute(self, workflow_inputs: Dict[str, weaver.typedefs.CWL_RuntimeInput], out_dir: str, expected_outputs: Dict[str, str])[source]

Execute a remote process using the given inputs. The function is expected to monitor the process and update the status. Retrieve the expected outputs and store them in the out_dir.

Parameters
  • workflow_inputsCWL job dict

  • out_dir – directory where the outputs must be written

  • expected_outputs – expected value outputs as {‘id’: ‘value’}

make_request(self, method, url, retry, status_code_mock=None, **kwargs)[source]
static host_file(file_name)[source]
weaver.processes.wps_testing
Module Contents
class weaver.processes.wps_testing.WpsTestProcess(**kw)[source]

Test WPS process definition that simply returns its input string as output.

type[source]
_handler(self, request, response)[source]
weaver.processes.wps_workflow
Module Contents
weaver.processes.wps_workflow.LOGGER[source]
weaver.processes.wps_workflow.DEFAULT_TMP_PREFIX = tmp[source]
weaver.processes.wps_workflow.default_make_tool(toolpath_object: weaver.typedefs.ToolPathObjectType, loading_context: cwltool.context.LoadingContext, get_job_process_definition: weaver.typedefs.GetJobProcessDefinitionFunction)cwltool.process.Process[source]
class weaver.processes.wps_workflow.CallbackJob(: WpsWorkflow, job: Callable[[Any, Any], Any], output_callback: cwltool.builder.Builder, cachebuilder: Text, jobcache)[source]
run(self: cwltool.context.RuntimeContext, loading_context)None[source]
class weaver.processes.wps_workflow.WpsWorkflow(: Dict[Text, Any], toolpath_object: cwltool.context.LoadingContext, loading_context: weaver.typedefs.GetJobProcessDefinitionFunction, get_job_process_definition)[source]

Definition of a CWL workflow that can execute WPS application packages as defined by weaver.processes.wps_package.WpsPackage as job steps.

Build a Process object from the provided dictionary.

job(self, joborder: Dict[Text, weaver.typedefs.AnyValue], output_callbacks: Callable[[Any, Any], Any], runtime_context: cwltool.context.RuntimeContext)Generator[Union[cwltool.job.JobBase, CallbackJob], None, None][source]

Workflow job generator.

Parameters
  • joborder – inputs of the job submission

  • output_callbacks – method to fetch step outputs and corresponding step details

  • runtime_context – configs about execution environment

Returns

collect_output_ports(self, ports: Set[Dict[Text, Any]], builder: cwltool.builder.Builder, outdir: Text, compute_checksum: bool = True, jobname: Text = '', readers: Dict[Text, Any] = None)cwltool.command_line_tool.OutputPorts[source]
collect_output(self, schema: Dict[Text, Any], builder: cwltool.builder.Builder, outdir: Text, fs_access: cwltool.stdfsaccess.StdFsAccess, compute_checksum: bool = True)Optional[Union[Dict[Text, Any], List[Union[Dict[Text, Any], Text]]]][source]
class weaver.processes.wps_workflow.WpsWorkflowJob(builder: cwltool.builder.Builder, joborder: Dict[Text, Union[Dict[Text, Any], List, Text, None]], requirements: List[Dict[Text, Text]], hints: List[Dict[Text, Text]], name: Text, wps_process: weaver.processes.wps_process_base.WpsProcessInterface, expected_outputs: List[weaver.typedefs.ExpectedOutputType])[source]

Initialize the job object.

run(self, runtimeContext: cwltool.context.RuntimeContext, tmpdir_lock: Optional[threading.Lock] = None)None[source]
execute(self: List[Text], runtime: MutableMapping[Text, Text], env: cwltool.context.RuntimeContext, runtime_context)None[source]
Package Contents
weaver.processes.includeme(config)[source]
weaver.store
Submodules
weaver.store.base
Module Contents
weaver.store.base.JobListAndCount[source]
class weaver.store.base.StoreInterface[source]
type[source]
class weaver.store.base.StoreServices[source]
type = services[source]
abstract save_service(self: weaver.datatype.Service, service: bool, overwrite=True)weaver.datatype.Service[source]
abstract delete_service(self: str, name)bool[source]
abstract list_services(self)List[weaver.datatype.Service][source]
abstract fetch_by_name(self: str, name: Optional[str], visibility=None)weaver.datatype.Service[source]
abstract fetch_by_url(self: str, url)weaver.datatype.Service[source]
abstract clear_services(self)bool[source]
class weaver.store.base.StoreProcesses[source]
type = processes[source]
abstract save_process(self: Union[weaver.datatype.Process, pywps.Process], process: bool, overwrite=True)weaver.datatype.Process[source]
abstract delete_process(self: str, process_id: Optional[str], visibility=None)bool[source]
abstract list_processes(self: Optional[str], visibility=None)List[weaver.datatype.Process][source]
abstract fetch_by_id(self: str, process_id: Optional[str], visibility=None)weaver.datatype.Process[source]
abstract get_visibility(self: str, process_id)str[source]
abstract set_visibility(self: str, process_id: str, visibility)None[source]
abstract clear_processes(self)bool[source]
class weaver.store.base.StoreJobs[source]
type = jobs[source]
abstract save_job(self, task_id: str, process: str, service: Optional[str] = None, inputs: Optional[List[Any]] = None, is_workflow: bool = False, is_local: bool = False, user_id: Optional[int] = None, execute_async: bool = True, custom_tags: Optional[List[str]] = None, access: Optional[str] = None, notification_email: Optional[str] = None, accept_language: Optional[str] = None, created: Optional[datetime.datetime] = None)weaver.datatype.Job[source]
abstract update_job(self: weaver.datatype.Job, job)weaver.datatype.Job[source]
abstract delete_job(self: str, job_id)bool[source]
abstract fetch_by_id(self: str, job_id)weaver.datatype.Job[source]
abstract list_jobs(self)List[weaver.datatype.Job][source]
abstract find_jobs(self, process: Optional[str] = None, service: Optional[str] = None, tags: Optional[List[str]] = None, access: Optional[str] = None, notification_email: Optional[str] = None, status: Optional[str] = None, sort: Optional[str] = None, page: int = 0, limit: int = 10, datetime: Optional[weaver.typedefs.DatetimeIntervalType] = None, group_by: Optional[Union[str, List[str]]] = None, request: Optional[pyramid.request.Request] = None)Union[JobListAndCount, JobCategoriesAndCount][source]
abstract clear_jobs(self)bool[source]
class weaver.store.base.StoreQuotes[source]
type = quotes[source]
abstract save_quote(self: weaver.datatype.Quote, quote)weaver.datatype.Quote[source]
abstract fetch_by_id(self: str, quote_id)weaver.datatype.Quote[source]
abstract list_quotes(self)List[weaver.datatype.Quote][source]
abstract find_quotes(self: Optional[str], process_id: int = None, page: int = 0, limit: Optional[str] = 10, sort=None)Tuple[List[weaver.datatype.Quote], int][source]
class weaver.store.base.StoreBills[source]
type = bills[source]
abstract save_bill(self: weaver.datatype.Bill, bill)weaver.datatype.Bill[source]
abstract fetch_by_id(self: str, bill_id)weaver.datatype.Bill[source]
abstract list_bills(self)List[weaver.datatype.Bill][source]
abstract find_bills(self: Optional[str], quote_id: int = None, page: int = 0, limit: Optional[str] = 10, sort=None)Tuple[List[weaver.datatype.Bill], int][source]
weaver.store.mongodb

Stores to read/write data to from/to MongoDB using pymongo.

Module Contents
weaver.store.mongodb.LOGGER[source]
class weaver.store.mongodb.MongodbStore(: pymongo.collection.Collection, collection: Optional[Dict[str, Any]], sane_name_config=None)[source]

Base class extended by all concrete store implementations.

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 weaver.store.mongodb.MongodbServiceStore(*args, **kwargs)[source]

Registry for OWS services. Uses MongoDB to store service url and attributes.

save_service(self: weaver.datatype.Service, service: bool, overwrite=True)weaver.datatype.Service[source]

Stores an OWS service in mongodb.

delete_service(self: str, name)bool[source]

Removes service from MongoDB storage.

list_services(self)List[weaver.datatype.Service][source]

Lists all services in MongoDB storage.

fetch_by_name(self: str, name: Optional[str], visibility=None)weaver.datatype.Service[source]

Gets service for given name from MongoDB storage.

fetch_by_url(self: str, url)weaver.datatype.Service[source]

Gets service for given url from MongoDB storage.

clear_services(self)bool[source]

Removes all OWS services from MongoDB storage.

class weaver.store.mongodb.MongodbProcessStore(*args, **kwargs)[source]

Registry for processes. Uses MongoDB to store processes and attributes.

_register_defaults(self: List[weaver.datatype.Process], processes)None[source]

Default process registration to apply definition updates with duplicate entry handling.

_add_process(self: weaver.typedefs.AnyProcess, process)None[source]
static _get_process_field(process: weaver.typedefs.AnyProcess, function_dict: Union[Dict[weaver.typedefs.AnyProcessType, Callable[], Any]], Callable[], Any]])Any[source]

Takes a lambda expression or a dict of process-specific lambda expressions to retrieve a field. Validates that the passed process object is one of the supported types.

Parameters
  • process – process to retrieve the field from.

  • function_dict – lambda or dict of lambda of process type

Returns

retrieved field if the type was supported

Raises

ProcessInstanceError – invalid process type

_get_process_id(self: weaver.typedefs.AnyProcess, process)str[source]
_get_process_type(self: weaver.typedefs.AnyProcess, process)str[source]
_get_process_endpoint_wps1(self: weaver.typedefs.AnyProcess, process)str[source]
save_process(self: Union[weaver.datatype.Process, pywps.Process], process: bool, overwrite=True)weaver.datatype.Process[source]

Stores a process in storage.

Parameters
  • process – An instance of weaver.datatype.Process.

  • overwrite – Overwrite the matching process instance by name if conflicting.

delete_process(self: str, process_id: Optional[str], visibility=None)bool[source]

Removes process from database, optionally filtered by visibility. If visibility=None, the process is deleted (if existing) regardless of its visibility value.

list_processes(self: Optional[str], visibility=None)List[weaver.datatype.Process][source]

Lists all processes in database, optionally filtered by visibility.

Parameters

visibility – One value amongst weaver.visibility.

fetch_by_id(self: str, process_id: Optional[str], visibility=None)weaver.datatype.Process[source]

Get process for given process_id from storage, optionally filtered by visibility. If visibility=None, the process is retrieved (if existing) regardless of its visibility value.

Parameters
  • process_id – process identifier

  • visibility – one value amongst weaver.visibility.

Returns

An instance of weaver.datatype.Process.

get_visibility(self: str, process_id)str[source]

Get visibility of a process.

Returns

One value amongst weaver.visibility.

set_visibility(self: str, process_id: str, visibility)None[source]

Set visibility of a process.

Parameters
  • visibility – One value amongst weaver.visibility.

  • process_id

Raises
clear_processes(self)bool[source]

Clears all processes from the store.

class weaver.store.mongodb.MongodbJobStore(*args, **kwargs)[source]

Registry for process jobs tracking. Uses MongoDB to store job attributes.

save_job(self, task_id: str, process: str, service: Optional[str] = None, inputs: Optional[List[Any]] = None, is_workflow: bool = False, is_local: bool = False, user_id: Optional[int] = None, execute_async: bool = True, custom_tags: Optional[List[str]] = None, access: Optional[str] = None, notification_email: Optional[str] = None, accept_language: Optional[str] = None, created: Optional[datetime.datetime] = None)weaver.datatype.Job[source]

Creates a new Job and stores it in mongodb.

update_job(self: weaver.datatype.Job, job)weaver.datatype.Job[source]

Updates a job parameters in MongoDB storage. :param job: instance of weaver.datatype.Job.

delete_job(self: str, job_id)bool[source]

Removes job from MongoDB storage.

fetch_by_id(self: str, job_id)weaver.datatype.Job[source]

Gets job for given job_id from MongoDB storage.

list_jobs(self)List[weaver.datatype.Job][source]

Lists all jobs in MongoDB storage. For user-specific access to available jobs, use MongodbJobStore.find_jobs() instead.

find_jobs(self, process: Optional[str] = None, service: Optional[str] = None, tags: Optional[List[str]] = None, access: Optional[str] = None, notification_email: Optional[str] = None, status: Optional[str] = None, sort: Optional[str] = None, page: int = 0, limit: int = 10, datetime: Optional[weaver.store.base.DatetimeIntervalType] = None, group_by: Optional[Union[str, List[str]]] = None, request: Optional[pyramid.request.Request] = None)Union[weaver.store.base.JobListAndCount, weaver.store.base.JobCategoriesAndCount][source]

Finds all jobs in MongoDB storage matching search filters to obtain results with requested paging or grouping.

Parameters
  • request – request that lead to this call to obtain permissions and user id.

  • process – process name to filter matching jobs.

  • service – service name to filter matching jobs.

  • tags – list of tags to filter matching jobs.

  • access – access visibility to filter matching jobs (default: VISIBILITY_PUBLIC).

  • notification_email – notification email to filter matching jobs.

  • status – status to filter matching jobs.

  • sort – field which is used for sorting results (default: creation date, descending).

  • page – page number to return when using result paging (only when not using group_by).

  • limit – number of jobs per page when using result paging (only when not using group_by).

  • datetime – field used for filtering data by creation date with a given date or interval of date.

  • group_by – one or many fields specifying categories to form matching groups of jobs (paging disabled).

Returns

(list of jobs matching paging OR list of {categories, list of jobs, count}) AND total of matched job

Example:

Using paging (default), result will be in the form:

(
    [Job(1), Job(2), Job(3), ...],
    <total>
)

Where <total> will indicate the complete count of matched jobs with filters, but the list of jobs will be limited only to page index and limit specified.

Using grouping with a list of field specified with group_by, results will be in the form:

(
    [{category: {field1: valueA, field2: valueB, ...}, [Job(1), Job(2), ...], count: <count>},
     {category: {field1: valueC, field2: valueD, ...}, [Job(x), Job(y), ...], count: <count>},
     ...
    ],
    <total>
)

Where <total> will again indicate all matched jobs by every category combined, and <count> will indicate the amount of jobs matched for each individual category. Also, category will indicate values of specified fields (from group_by) that compose corresponding jobs with matching values.

clear_jobs(self)bool[source]

Removes all jobs from MongoDB storage.

class weaver.store.mongodb.MongodbQuoteStore(*args, **kwargs)[source]

Registry for quotes. Uses MongoDB to store quote attributes.

save_quote(self: weaver.datatype.Quote, quote)weaver.datatype.Quote[source]

Stores a quote in mongodb.

fetch_by_id(self: str, quote_id)weaver.datatype.Quote[source]

Gets quote for given quote_id from MongoDB storage.

list_quotes(self)List[weaver.datatype.Quote][source]

Lists all quotes in MongoDB storage.

find_quotes(self: Optional[str], process_id: int = None, page: int = 0, limit: Optional[str] = 10, sort=None)Tuple[List[weaver.datatype.Quote], int][source]

Finds all quotes in MongoDB storage matching search filters.

Returns a tuple of filtered items and their count, where items can have paging and be limited to a maximum per page, but count always indicate the total number of matches.

class weaver.store.mongodb.MongodbBillStore(*args, **kwargs)[source]

Registry for bills. Uses MongoDB to store bill attributes.

save_bill(self: weaver.datatype.Bill, bill)weaver.datatype.Bill[source]

Stores a bill in mongodb.

fetch_by_id(self: str, bill_id)weaver.datatype.Bill[source]

Gets bill for given bill_id from MongoDB storage.

list_bills(self)List[weaver.datatype.Bill][source]

Lists all bills in MongoDB storage.

find_bills(self: Optional[str], quote_id: int = None, page: int = 0, limit: Optional[str] = 10, sort=None)Tuple[List[weaver.datatype.Bill], int][source]

Finds all bills in MongoDB storage matching search filters.

Returns a tuple of filtered items and their count, where items can have paging and be limited to a maximum per page, but count always indicate the total number of matches.

weaver.wps

Views for WPS-XML endpoint implemented with pywps.

Submodules
weaver.wps.app
Module Contents
weaver.wps.app.LOGGER[source]
weaver.wps.app.pywps_view(environ, start_response)[source]

Served location for PyWPS Service that provides WPS-1/2 XML endpoint.

weaver.wps.service
Module Contents
weaver.wps.service.LOGGER[source]
class weaver.wps.service.ReferenceStatusLocationStorage(: str, url_location: weaver.typedefs.SettingsType, settings)[source]

Simple storage that simply redirects to a pre-existing status location.

url(self, *_, **__)[source]
Parameters

destination – the name of the output to calculate the url for

Returns

URL where file_name can be reached

location(self, *_, **__)[source]

Provides a location for the specified destination. This may be any path, pathlike object, db connection string, URL, etc and it is not guaranteed to be accessible on the local file system :param destination: the name of the output to calculate

the location for

Returns

location where file_name can be found

store(self, *_, **__)[source]
Parameters

output – of type IOHandler

Returns

(type, store, url) where type - is type of STORE_TYPE - number store - string describing storage - file name, database connection url - url, where the data can be downloaded

write(self, *_, **__)[source]
Parameters
  • data – data to write to storage

  • destination – identifies the destination to write to storage generally a file name which can be interpreted by the implemented Storage class in a manner of its choosing

  • data_format – Optional parameter of type pywps.inout.formats.FORMAT describing the format of the data to write.

Returns

url where the data can be downloaded

class weaver.wps.service.WorkerExecuteResponse(: pywps.app.WPSRequest, wps_request: str, uuid: pywps.app.Process, process: str, job_url: weaver.typedefs.SettingsType, settings: Any, *_: Any, **__)[source]

XML response generator from predefined job status URL and executed process definition.

constructor

Parameters
  • wps_request (pywps.app.WPSRequest.WPSRequest) –

  • process (pywps.app.Process.Process) –

  • uuid – string this request uuid

class weaver.wps.service.WorkerService(*_, is_worker=False, settings=None, **__)[source]

Dispatches PyWPS requests from WPS-1/2 XML endpoint to WPS-REST as appropriate.

Note

For every WPS-Request type, the parsing of XML content is already handled by the PyWPS service for GET/POST. All data must be retrieved from parsed WPSRequest to avoid managing argument location and WPS versions.

When GetCapabilities or DescribeProcess requests are received, directly return to result as XML based on content (no need to subprocess as Celery task that gets resolved quickly with only the process(es) details). When JSON content is requested, instead return the redirect link to corresponding WPS-REST API endpoint.

When receiving Execute request, convert the XML payload to corresponding JSON and dispatch it to the Celery Worker to actually process it after job setup for monitoring.

_get_capabilities_redirect(self: pywps.app.WPSRequest, wps_request: Any, *_: Any, **__)Optional[Union[pywps.response.WPSResponse, weaver.typedefs.HTTPValid]][source]

Redirects to WPS-REST endpoint if requested Content-Type is JSON.

get_capabilities(self: pywps.app.WPSRequest, wps_request: Any, *_: Any, **__)Union[pywps.response.WPSResponse, weaver.typedefs.HTTPValid][source]

Redirect to WPS-REST endpoint if requested Content-Type is JSON or handle GetCapabilities normally.

_describe_process_redirect(self: pywps.app.WPSRequest, wps_request: Any, *_: Any, **__)Optional[Union[pywps.response.WPSResponse, weaver.typedefs.HTTPValid]][source]

Redirects to WPS-REST endpoint if requested Content-Type is JSON.

describe(self: pywps.app.WPSRequest, wps_request: Any, *_: Any, **__)Union[pywps.response.WPSResponse, weaver.typedefs.HTTPValid][source]

Redirect to WPS-REST endpoint if requested Content-Type is JSON or handle DescribeProcess normally.

_submit_job(self: pywps.app.WPSRequest, wps_request)Union[pywps.response.WPSResponse, weaver.typedefs.HTTPValid, weaver.typedefs.JSON][source]

Dispatch operation to WPS-REST endpoint, which in turn should call back the real Celery Worker for execution.

prepare_process_for_execution(self: str, identifier)pywps.app.Process[source]

Handles dispatched remote provider process preparation during execution request.

execute(self: str, identifier: pywps.app.WPSRequest, wps_request: str, uuid)Union[pywps.response.WPSResponse, weaver.typedefs.HTTPValid][source]

Submit WPS request to corresponding WPS-REST endpoint and convert back for requested Accept content-type.

Overrides the original execute operation, that instead will get handled by execute_job() following callback from Celery Worker that handles process job creation and monitoring.

If Accept is JSON, the result is directly returned from _submit_job(). If Accept is XML or undefined, WorkerExecuteResponse converts the received JSON with XML template.

execute_job(self: str, process_id: List[weaver.processes.convert.WPS_Input_Type], wps_inputs: List[weaver.processes.convert.WPS_Output_Type], wps_outputs: str, mode: str, job_uuid: Optional[weaver.datatype.Process], remote_process)owslib.wps.WPSExecution[source]

Real execution of the process by active Celery Worker.

weaver.wps.service.get_pywps_service(environ=None, is_worker=False)[source]

Generates the PyWPS Service that provides WPS-1/2 XML endpoint.

weaver.wps.utils
Module Contents
weaver.wps.utils.LOGGER[source]
weaver.wps.utils._get_settings_or_wps_config(container: weaver.typedefs.AnySettingsContainer, weaver_setting_name: str, config_setting_section: str, config_setting_name: str, default_not_found: str, message_not_found: str)str[source]
weaver.wps.utils.get_wps_path(container: weaver.typedefs.AnySettingsContainer)str[source]

Retrieves the WPS path (without hostname).

Searches directly in settings, then weaver.wps_cfg file, or finally, uses the default values if not found.

weaver.wps.utils.get_wps_url(container: weaver.typedefs.AnySettingsContainer)str[source]

Retrieves the full WPS URL (hostname + WPS path)

Searches directly in settings, then weaver.wps_cfg file, or finally, uses the default values if not found.

weaver.wps.utils.get_wps_output_dir(container: weaver.typedefs.AnySettingsContainer)str[source]

Retrieves the WPS output directory path where to write XML and result files. Searches directly in settings, then weaver.wps_cfg file, or finally, uses the default values if not found.

weaver.wps.utils.get_wps_output_path(container: weaver.typedefs.AnySettingsContainer)str[source]

Retrieves the WPS output path (without hostname) for staging XML status, logs and process outputs. Searches directly in settings, then weaver.wps_cfg file, or finally, uses the default values if not found.

weaver.wps.utils.get_wps_output_url(container: weaver.typedefs.AnySettingsContainer)str[source]

Retrieves the WPS output URL that maps to WPS output directory path. Searches directly in settings, then weaver.wps_cfg file, or finally, uses the default values if not found.

weaver.wps.utils.get_wps_local_status_location(url_status_location: str, container: weaver.typedefs.AnySettingsContainer, must_exist: bool = True)Optional[str][source]

Attempts to retrieve the local XML file path corresponding to the WPS status location as URL.

Parameters
  • url_status_location – URL reference pointing to some WPS status location XML.

  • container – any settings container to map configured local paths.

  • must_exist – return only existing path if enabled, otherwise return the parsed value without validation.

Returns

found local file path if it exists, None otherwise.

weaver.wps.utils._describe_process_cached(self: owslib.wps.WebProcessingService, identifier: str, xml: Optional[weaver.typedefs.XML] = None)weaver.typedefs.ProcessOWS[source]
weaver.wps.utils._get_wps_client_cached(url: str, headers: weaver.typedefs.HeadersType, verify: bool, language: Optional[str])owslib.wps.WebProcessingService[source]
weaver.wps.utils.get_wps_client(url: str, container: Optional[weaver.typedefs.AnySettingsContainer] = None, verify: bool = None, headers: Optional[weaver.typedefs.HeadersType] = None, language: Optional[str] = None)owslib.wps.WebProcessingService[source]

Obtains a WebProcessingService with pre-configured request options for the given URL.

Parameters
  • url – WPS URL location.

  • container – request or settings container to retrieve headers and other request options.

  • verify – flag to enable SSL verification (overrides request options from container).

  • headers – specific headers to apply (overrides retrieved ones from container).

  • language – preferred response language if supported by the service.

Returns

created WPS client object with configured request options.

weaver.wps.utils.check_wps_status(location: Optional[str] = None, response: Optional[weaver.typedefs.XML] = None, sleep_secs: int = 2, verify: bool = True, settings: Optional[weaver.typedefs.AnySettingsContainer] = None)owslib.wps.WPSExecution[source]

Run owslib.wps.WPSExecution.checkStatus() with additional exception handling.

Parameters
  • location – job URL or file path where to look for job status.

  • response – WPS response document of job status.

  • sleep_secs – number of seconds to sleep before returning control to the caller.

  • verify – flag to enable SSL verification.

  • settings – application settings to retrieve any additional request parameters as applicable.

Returns

OWSLib.wps.WPSExecution object.

weaver.wps.utils.load_pywps_config(container: weaver.typedefs.AnySettingsContainer, config: Optional[Union[str, Dict[str, str]]] = None)configparser.ConfigParser[source]

Loads and updates the PyWPS configuration using Weaver settings.

weaver.wps.utils.set_wps_language(wps: owslib.wps.WebProcessingService, accept_language: Optional[str] = None, request: Optional[weaver.typedefs.AnyRequestType] = None)None[source]

Set the language property on the WebProcessingService object.

Given the Accept-Language header value, match the best language to the supported languages.

By default, and if no match is found, the WebProcessingService.language property is set to None.

https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept-Language (q-factor weighting is ignored, only order is considered)

Parameters
  • wps – process for which to set the language header if it is accepted

  • accept_language (str) – the value of the Accept-Language header

  • request – request from which to extract Accept-Language header if not provided directly

Package Contents
weaver.wps.includeme(config)[source]
weaver.wps_restapi
Subpackages
weaver.wps_restapi.jobs
Submodules
weaver.wps_restapi.jobs.jobs
Module Contents
weaver.wps_restapi.jobs.jobs.LOGGER[source]
weaver.wps_restapi.jobs.jobs.get_job(request: pyramid.request.Request)weaver.datatype.Job[source]

Obtain a job from request parameters.

Returns

Job information if found.

Raises

HTTPNotFound – with JSON body details on missing/non-matching job, process, provider IDs.

weaver.wps_restapi.jobs.jobs.get_results(job: weaver.datatype.Job, container: weaver.typedefs.AnySettingsContainer, value_key: Optional[str] = None, ogc_api: bool = False)Union[List[weaver.typedefs.JSON], weaver.typedefs.JSON][source]

Obtains the job results with extended full WPS output URL as applicable and according to configuration settings.

Parameters
  • job – job from which to retrieve results.

  • container – any container giving access to instance settings (to resolve reference output location).

  • value_key – If not specified, the returned values will have the appropriate data/href key according to the content. Otherwise, all values will have the specified key.

  • ogc_api – If True, formats the results using the OGC-API - Processes format.

Returns

list of all outputs each with minimally an ID and value under the requested key.

weaver.wps_restapi.jobs.jobs.validate_service_process(request: pyramid.request.Request)Tuple[Optional[str], Optional[str]][source]

Verifies that service or process specified by path or query will raise the appropriate error if applicable.

weaver.wps_restapi.jobs.jobs.get_queried_jobs(request)[source]

Retrieve the list of jobs which can be filtered, sorted, paged and categorized using query parameters.

weaver.wps_restapi.jobs.jobs.get_job_status(request)[source]

Retrieve the status of a job.

weaver.wps_restapi.jobs.jobs.cancel_job(request)[source]

Dismiss a job.

Note: Will only stop tracking this particular process (WPS 1.0 doesn’t allow to stop a process)

weaver.wps_restapi.jobs.jobs.get_job_inputs(request: pyramid.request.Request)pyramid.httpexceptions.HTTPException[source]

Retrieve the inputs of a job.

weaver.wps_restapi.jobs.jobs.get_job_outputs(request: pyramid.request.Request)pyramid.httpexceptions.HTTPException[source]

Retrieve the outputs of a job.

weaver.wps_restapi.jobs.jobs.get_job_results(request: pyramid.request.Request)pyramid.httpexceptions.HTTPException[source]

Retrieve the results of a job.

weaver.wps_restapi.jobs.jobs.get_job_exceptions(request)[source]

Retrieve the exceptions of a job.

weaver.wps_restapi.jobs.jobs.get_job_logs(request)[source]

Retrieve the logs of a job.

weaver.wps_restapi.jobs.jobs.redirect_job_result(request)[source]

Deprecated job result endpoint that is now returned by corresponding outputs path with added links.

Package Contents
weaver.wps_restapi.jobs.LOGGER[source]
weaver.wps_restapi.jobs.includeme(config)[source]
weaver.wps_restapi.processes
Submodules
weaver.wps_restapi.processes.processes
Module Contents
weaver.wps_restapi.processes.processes.LOGGER[source]
weaver.wps_restapi.processes.processes.submit_provider_job(request)[source]

Execute a remote provider process.

weaver.wps_restapi.processes.processes.list_remote_processes(service: weaver.datatype.Service, request: pyramid.request.Request)List[weaver.datatype.Process][source]

Obtains a list of remote service processes in a compatible weaver.datatype.Process format.

Note: remote processes won’t be stored to the local process storage.

weaver.wps_restapi.processes.processes.get_provider_processes(request)[source]

Retrieve available provider processes (GetCapabilities).

weaver.wps_restapi.processes.processes.describe_provider_process(request: pyramid.request.Request)weaver.datatype.Process[source]

Obtains a remote service process description in a compatible local process format.

Note: this processes won’t be stored to the local process storage.

weaver.wps_restapi.processes.processes.get_provider_process(request)[source]

Retrieve a process description (DescribeProcess).

weaver.wps_restapi.processes.processes.get_processes_filtered_by_valid_schemas(request: pyramid.request.Request)Tuple[List[weaver.typedefs.JSON], List[str]][source]

Validates the processes summary schemas and returns them into valid/invalid lists. :returns: list of valid process summaries and invalid processes IDs for manual cleanup.

weaver.wps_restapi.processes.processes.get_processes(request)[source]

List registered processes (GetCapabilities). Optionally list both local and provider processes.

weaver.wps_restapi.processes.processes.add_local_process(request)[source]

Register a local process.

weaver.wps_restapi.processes.processes.get_local_process(request)[source]

Get a registered local process information (DescribeProcess).

weaver.wps_restapi.processes.processes.get_local_process_package(request)[source]

Get a registered local process package definition.

weaver.wps_restapi.processes.processes.get_local_process_payload(request)[source]

Get a registered local process payload definition.

weaver.wps_restapi.processes.processes.get_process_visibility(request)[source]

Get the visibility of a registered local process.

weaver.wps_restapi.processes.processes.set_process_visibility(request)[source]

Set the visibility of a registered local process.

weaver.wps_restapi.processes.processes.delete_local_process(request)[source]

Unregister a local process.

weaver.wps_restapi.processes.processes.submit_local_job(request)[source]

Execute a process registered locally. Execution location and method is according to deployed Application Package.

Package Contents
weaver.wps_restapi.processes.LOGGER[source]
weaver.wps_restapi.processes.includeme(config)[source]
weaver.wps_restapi.providers
Submodules
weaver.wps_restapi.providers.providers
Module Contents
weaver.wps_restapi.providers.providers.LOGGER[source]
weaver.wps_restapi.providers.providers.get_provider_services(request: pyramid.request.Request)List[weaver.datatype.Service][source]

Obtain the list of remote provider services.

weaver.wps_restapi.providers.providers.get_providers(request)[source]

Lists registered providers.

weaver.wps_restapi.providers.providers.get_capabilities(service, request)[source]

GetCapabilities of a wps provider.

weaver.wps_restapi.providers.providers.get_service(request)[source]

Get the request service using provider_id from the service store.

weaver.wps_restapi.providers.providers.add_provider(request)[source]

Add a provider.

weaver.wps_restapi.providers.providers.remove_provider(request)[source]

Remove a provider.

weaver.wps_restapi.providers.providers.get_provider(request)[source]

Get a provider definition (GetCapabilities).

Package Contents
weaver.wps_restapi.providers.LOGGER[source]
weaver.wps_restapi.providers.includeme(config)[source]
weaver.wps_restapi.quotation
Submodules
weaver.wps_restapi.quotation.bills
Module Contents
weaver.wps_restapi.quotation.bills.LOGGER[source]
weaver.wps_restapi.quotation.bills.get_bill_list(request)[source]

Get list of bills IDs.

weaver.wps_restapi.quotation.bills.get_bill_info(request)[source]

Get bill information.

weaver.wps_restapi.quotation.quotes
Module Contents
weaver.wps_restapi.quotation.quotes.LOGGER[source]
weaver.wps_restapi.quotation.quotes.process_quote_estimator(process)[source]
Parameters

process – instance of weaver.datatype.Process for which to evaluate the quote.

Returns

dict of {price, currency, estimatedTime} values for the process quote.

weaver.wps_restapi.quotation.quotes.request_quote(request)[source]

Request a quotation for a process.

weaver.wps_restapi.quotation.quotes.get_quote_list(request)[source]

Get list of quotes IDs.

weaver.wps_restapi.quotation.quotes.get_quote_info(request)[source]

Get quote information.

weaver.wps_restapi.quotation.quotes.execute_quote(request)[source]

Execute a quoted process.

Package Contents
weaver.wps_restapi.quotation.LOGGER[source]
weaver.wps_restapi.quotation.includeme(config)[source]
Submodules
weaver.wps_restapi.api
Module Contents
weaver.wps_restapi.api.LOGGER[source]
weaver.wps_restapi.api.api_frontpage(request)[source]

Frontpage of Weaver.

weaver.wps_restapi.api.api_frontpage_body(settings: weaver.typedefs.SettingsType)weaver.typedefs.JSON[source]

Generates the JSON body describing the Weaver API and documentation references.

weaver.wps_restapi.api.api_versions(request: pyramid.request.Request)pyramid.httpexceptions.HTTPException[source]

Weaver versions information.

weaver.wps_restapi.api.api_conformance(request: pyramid.request.Request)pyramid.httpexceptions.HTTPException[source]

Weaver specification conformance information.

weaver.wps_restapi.api.get_openapi_json(http_scheme: str = 'http', http_host: str = 'localhost', base_url: Optional[str] = None, use_refs: bool = True, use_docstring_summary: bool = True, settings: Optional[weaver.typedefs.SettingsType] = None)weaver.typedefs.JSON[source]

Obtains the JSON schema of Weaver OpenAPI from request and response views schemas.

Parameters
  • http_scheme – Protocol scheme to use for building the API base if not provided by base URL parameter.

  • http_host – Hostname to use for building the API base if not provided by base URL parameter.

  • base_url – Explicit base URL to employ of as API base instead of HTTP scheme/host parameters.

  • use_refs – Generate schemas with $ref definitions or expand every schema content.

  • use_docstring_summary – Extra function docstring to auto-generate the summary field of responses.

  • settings – Application settings to retrieve further metadata details to be added to the OpenAPI.

weaver.wps_restapi.api.openapi_json_cached(*args, **kwargs)[source]
weaver.wps_restapi.api.openapi_json(request: pyramid.request.Request)dict[source]

Weaver OpenAPI schema definitions.

weaver.wps_restapi.api.swagger_ui_cached(request)[source]
weaver.wps_restapi.api.api_swagger_ui(request)[source]

Weaver OpenAPI schema definitions rendering using Swagger-UI viewer.

weaver.wps_restapi.api.redoc_ui_cached(request)[source]
weaver.wps_restapi.api.api_redoc_ui(request)[source]

Weaver OpenAPI schema definitions rendering using Redoc viewer.

weaver.wps_restapi.api.get_request_info(request: pyramid.request.Request, detail: Optional[str] = None)weaver.typedefs.JSON[source]

Provided additional response details based on the request and execution stack on failure.

weaver.wps_restapi.api.ows_json_format(function)[source]

Decorator that adds additional detail in the response’s JSON body if this is the returned content-type.

weaver.wps_restapi.api.not_found_or_method_not_allowed(request)[source]

Overrides the default is 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.

weaver.wps_restapi.api.unauthorized_or_forbidden(request)[source]

Overrides the default is HTTPForbidden [403] by appropriate HTTPUnauthorized [401] when applicable.

Unauthorized response is for restricted user access according to credentials and/or authorization headers. Forbidden response is for operation refused by the underlying process operations.

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

weaver.wps_restapi.colander_extras

This module offers multiple utility schema definitions to be employed with colander and cornice_swagger.

The colander.SchemaNode provided here can be used in-place of colander ones, but giving you extended behaviour according to provided keywords. You can therefore do the following and all will be applied without modifying your code base.

# same applies for Mapping and Sequence schemas
from colander_extras import ExtendedSchemaNode as SchemaNode
from colander import SchemaNode     # instead of this

The schemas support extended cornice_swagger type converters so that you can generate OpenAPI-3 specifications. The original package support is limited to Swagger-2. You will also need additional in-place modifications provided here.

Since the intended usage is to generate JSON-deserialized data structures, the base colander.SchemaNode have some additional patches needed to handle JSON-native type conversion that are not directly offered by colander

The main classes extensions are:

Multiple <ExtensionType>SchemaNode variants are provided. You can use them as building blocks, gaining each of their respective feature, to make specific schema that meets your desired behaviour. The Extended-prefixed classes combined all available <ExtensionType>. Note that it is preferable to use the full Extended-prefixed classes over individual ones as they add complementary support of one-another features.

Warning

All node extensions assume that they are used for JSON data. Deserialization of unknown types could result in invalid result. Most of the time, Python native iterators such as tuples and generators could work and be converted to the corresponding sequence array (ie: list), but this is not guaranteed.

Warning

When defining schema nodes, DO NOT use the name keyword otherwise most mapping will fail validation as they cannot retrieve the same key-name from the passed dictionary for deserialize validation. Let the API figure out the name of the field automatically. Instead, use the keyword or field title for adjusting the displayed name in the Swagger UI. The same value will also be used to generate the $ref reference names of generated OpenAPI model definitions. If not explicitly provided, the value of title WILL default to the name of the schema node class.

Module Contents
weaver.wps_restapi.colander_extras.LITERAL_SCHEMA_TYPES[source]
exception weaver.wps_restapi.colander_extras.SchemaNodeTypeError[source]

Generic error indicating that the definition of a SchemaNode is invalid.

This usually means the user forgot to specify a required element for schema creation, or that a provided combination of keywords, sub-nodes and/or schema type don’t make any sense together, that they are erroneous, or that they cannot be resolved because of some kind of ambiguous definitions leading to multiple conflicting choices.

Initialize self. See help(type(self)) for accurate signature.

exception weaver.wps_restapi.colander_extras.ConversionTypeError[source]

Conversion error due to invalid type.

Initialize self. See help(type(self)) for accurate signature.

exception weaver.wps_restapi.colander_extras.ConversionValueError[source]

Conversion error due to invalid value.

Initialize self. See help(type(self)) for accurate signature.

class weaver.wps_restapi.colander_extras.OneOfCaseInsensitive(choices, msg_err=_MSG_ERR)[source]

Validator that ensures the given value matches one of the available choices, but allowing case insensitive values.

class weaver.wps_restapi.colander_extras.StringRange(min=None, max=None, **kwargs)[source]

Validator that provides the same functionalities as colander.Range for a numerical string value.

class weaver.wps_restapi.colander_extras.SchemeURL(schemes=None, msg=None, flags=re.IGNORECASE)[source]

String representation of an URL with extended set of allowed URI schemes.

See also

colander.url [remote http(s)/ftp(s)] colander.file_uri [local file://]

class weaver.wps_restapi.colander_extras.SemanticVersion(*args, v_prefix=False, rc_suffix=True, **kwargs)[source]

String representation that is valid against Semantic Versioning specification.

class weaver.wps_restapi.colander_extras.ExtendedBoolean(false_choices=('false', '0'), true_choices=(), false_val='false', true_val='true')[source]

A type representing a boolean object.

The constructor accepts these keyword arguments:

  • false_choices: The set of strings representing a False value on deserialization.

  • true_choices: The set of strings representing a True value on deserialization.

  • false_val: The value returned on serialization of a False value.

  • true_val: The value returned on serialization of a True value.

During deserialization, a value contained in false_choices, will be considered False.

The behaviour for values not contained in false_choices depends on true_choices: if it’s empty, any value is considered True; otherwise, only values contained in true_choices are considered True, and an Invalid exception would be raised for values outside of both false_choices and true_choices.

Serialization will produce true_val or false_val based on the value.

If the colander.null value is passed to the serialize method of this class, the colander.null value will be returned.

The subnodes of the colander.SchemaNode that wraps this type are ignored.

serialize(self, node, cstruct)[source]
class weaver.wps_restapi.colander_extras.ExtendedFloat[source]

A type representing a float.

If the colander.null value is passed to the serialize method of this class, the colander.null value will be returned.

The subnodes of the colander.SchemaNode that wraps this type are ignored.

serialize(self, node, cstruct)[source]
class weaver.wps_restapi.colander_extras.ExtendedInteger(strict=False)[source]

A type representing an integer.

If the colander.null value is passed to the serialize method of this class, the colander.null value will be returned.

The Integer constructor takes an optional argument strict, which if enabled will verify that the number passed to serialize/deserialize is an integer, and not a float that would get truncated.

The subnodes of the colander.SchemaNode that wraps this type are ignored.

serialize(self, node, cstruct)[source]
class weaver.wps_restapi.colander_extras.ExtendedString(encoding=None, allow_empty=False)[source]

A type representing a Unicode string.

This type constructor accepts two arguments:

encoding

Represents the encoding which should be applied to value serialization and deserialization, for example utf-8. If encoding is passed as None, the serialize method of this type will not do any special encoding of the appstruct it is provided, nor will the deserialize method of this type do any special decoding of the cstruct it is provided; inputs and outputs will be assumed to be Unicode. encoding defaults to None.

If encoding is None:

  • A Unicode input value to serialize is returned untouched.

  • A non-Unicode input value to serialize is run through the unicode() function without an encoding parameter (unicode(value)) and the result is returned.

  • A Unicode input value to deserialize is returned untouched.

  • A non-Unicode input value to deserialize is run through the unicode() function without an encoding parameter (unicode(value)) and the result is returned.

If encoding is not None:

  • A Unicode input value to serialize is run through the unicode function with the encoding parameter (unicode(value, encoding)) and the result (a str object) is returned.

  • A non-Unicode input value to serialize is converted to a Unicode using the encoding (unicode(value, encoding)); subsequently the Unicode object is re-encoded to a str object using the encoding and returned.

  • A Unicode input value to deserialize is returned untouched.

  • A non-Unicode input value to deserialize is converted to a str object using str(value). The resulting str value is converted to Unicode using the encoding (unicode(value, encoding)) and the result is returned.

A corollary: If a string (as opposed to a unicode object) is provided as a value to either the serialize or deserialize method of this type, and the type also has an non-None encoding, the string must be encoded with the type’s encoding. If this is not true, an colander.Invalid error will result.

allow_empty

Boolean, if True allows deserialization of an empty string. If False (default), empty strings will deserialize to colander.null

The subnodes of the colander.SchemaNode that wraps this type are ignored.

class weaver.wps_restapi.colander_extras.XMLObject[source]

Object that provides mapping to known XML extensions for OpenAPI schema definition.

Name of the schema definition in the OpenAPI will use :prop:`prefix` and the schema class name. Prefix can be omitted from the schema definition name by setting it to colander.drop. The value of title provided as option or

attribute[source]
name[source]
namespace[source]
prefix[source]
wrapped[source]
property xml(self)[source]
class weaver.wps_restapi.colander_extras.ExtendedNodeInterface[source]
_extension :str[source]
abstract _deserialize_impl(self, cstruct)[source]
class weaver.wps_restapi.colander_extras.ExtendedSchemaMeta(cls, name, bases, clsattrs)[source]
class weaver.wps_restapi.colander_extras.ExtendedSchemaBase(*args, **kwargs)[source]

Utility base node definition that initializes additional parameters at creation time of any other extended schema.

When no explicit title is specified by either keyword argument or field definition within container class, default it to the literal name of the class defining the schema node. This title can then be employed by other extended schema implementations to define cleaner schema references, notably in the case of KeywordMapper derived classes that do not necessarily have any explicit target name field.

When the schema node is a simple field within a container schema (mapping, sequence, etc.), operation is skipped to avoid applying the generic SchemaNode or ExtendedSchemaNode name of the basic node class. In this case, converters already employ the target name of the class attribute of the container schema under which that node gets created.

When the schema node is a generic colander.String without explicit validator, but that one can be inferred from either pattern or format OpenAPI definition, the corresponding validator gets automatically generated.

abstract static schema_type()[source]
static _validate(node)[source]
class weaver.wps_restapi.colander_extras.DropableSchemaNode(*args, **kwargs)[source]

Drops the underlying schema node if missing=drop was specified and that the value representing it represents an empty value.

In the case of nodes corresponding to literal schema type (i.e.: Integer, String, etc.), the empty value looked for is None. This is to make sure that 0 or "" are preserved unless explicitly representing no-data. In the case of container schema types (i.e.: list, dict, etc.), it is simply considered empty if there are no element in it, without any more explicit verification.

Original behaviour of schema classes that can have children nodes such as colander.MappingSchema and colander.SequenceSchema are to drop the sub-node only if its value is resolved as colander.null or colander.drop. This results in optional field definitions replaced by None in many implementations to raise colander.Invalid during deserialization. Inheriting this class in a schema definition will handle this situation automatically.

Required schemas (without missing=drop, defaulting to colander.required) will still raise for undefined nodes.

The following snippet shows the result that can be achieved using this schema class:

class SchemaA(DropableSchemaNode, MappingSchema):
    field = SchemaNode(String())

class SchemaB(MappingSchema):
    s1 = SchemaA(missing=drop)   # optional
    s2 = SchemaA()               # required

SchemaB().deserialize({"s1": None, "s2": {"field": "ok"}})
# results: {'s2': {'field': 'ok'}}
_extension = _ext_dropable[source]
abstract static schema_type()[source]
deserialize(self, cstruct)[source]

Deserialize the cstruct into an appstruct based on the schema, run this appstruct through the preparer, if one is present, then validate the prepared appstruct. The cstruct value is deserialized into an appstruct unconditionally.

If appstruct returned by type deserialization and preparation is the value colander.null, do something special before attempting validation:

  • If the missing attribute of this node has been set explicitly, return its value. No validation of this value is performed; it is simply returned.

  • If the missing attribute of this node has not been set explicitly, raise a colander.Invalid exception error.

If the appstruct is not colander.null and cannot be validated , a colander.Invalid exception will be raised.

If a cstruct argument is not explicitly provided, it defaults to colander.null.

_deserialize_impl(self, cstruct)[source]
class weaver.wps_restapi.colander_extras.DefaultSchemaNode(*args, **kwargs)[source]

If default keyword is provided during colander.SchemaNode creation, overrides the returned value by this default if missing from the structure during deserialize() call.

Original behaviour was to drop the missing value instead of replacing by default. Executes all other colander.SchemaNode operations normally.

_extension = _ext_default[source]
abstract static schema_type()[source]
deserialize(self, cstruct)[source]

Deserialize the cstruct into an appstruct based on the schema, run this appstruct through the preparer, if one is present, then validate the prepared appstruct. The cstruct value is deserialized into an appstruct unconditionally.

If appstruct returned by type deserialization and preparation is the value colander.null, do something special before attempting validation:

  • If the missing attribute of this node has been set explicitly, return its value. No validation of this value is performed; it is simply returned.

  • If the missing attribute of this node has not been set explicitly, raise a colander.Invalid exception error.

If the appstruct is not colander.null and cannot be validated , a colander.Invalid exception will be raised.

If a cstruct argument is not explicitly provided, it defaults to colander.null.

_deserialize_impl(self, cstruct)[source]
class weaver.wps_restapi.colander_extras.VariableSchemaNode(*args, **kwargs)[source]

Object schema that allows defining a field key as variable by name supporting deserialization validation.

This definition is useful for defining a dictionary where the key name can be any string value but contains an underlying schema that has a very specific structure to be validated, such as in the following example.

{
    "<any-key-id>": {
        "name": "required",
        "value": "something"
    },
    "<another-key-id>": {
        "name": "other required",
        "value": "same schema"
    }
}

This is accomplished using the following definition:

class RequiredDict(ExtendedMappingSchema):
    name = ExtendedSchemaNode(String())
    value = ExtendedSchemaNode(String())

class ContainerAnyKey(ExtendedMappingSchema):
    var = RequiredDict(variable="{id}")

In the above example, the var node name that would normally be automatically generated and used to define the dictionary key will be replaced by {id} (any string provided by variable keyword). The actual attribute name var could be replaced by anything.

Warning

Since variable tells the deserialization converter to try matching any valid children node schema with the provided structure regardless of key name, you should ensure that the variable child node has at least one colander.required field (either directly or much deeper in the structure) to ensure it has something to validate against. Otherwise, anything will be matched (ie: drop all for empty structure would be considered as valid).

The above statement also applies in case you provide more than one variable schema node under a mapping where both underlying schema are different. Without any required child node to distinguish between them, the sub-structure under each variable node could end up interchanged.

Note

It is recommended to use variable names that include invalid characters for class/attribute names (e.g.: {} or <>) in order to ensure that any substitution when attempting to find the schema matching the variable doesn’t result in overrides. As presented in the following example, const could get overridden if there was a structure to parse that contained both the const sub-structure and another one with an arbitrary key matched against <var>.

class ContainerAnyKeyWithName(ExtendedMappingSchema):
    var = RequiredDict(variable="const")  # 'const' could clash with other below
    const = RequiredDict(String())

Using <const> instead would ensure that no override occurs as it is a syntax error to write <const> = RequiredDict(String()) in the class definition, but this value can still be used to create the internal mapping to evaluate sub-schemas without name clashes. As a plus, it also helps giving an indication that any key is accepted.

_extension = _ext_variable[source]
_variable = variable[source]
_variable_map = variable_map[source]
classmethod is_variable(cls, node)[source]

If current node is the variable field definition.

has_variables(self)[source]

If the current container schema node has sub-node variables.

abstract static schema_type()[source]
_mark_variable_children(self)[source]

Verifies if a colander.MappingSchema (or any of its extensions) contains children VariableSchemaNode schema nodes for adequate deserialize() result later on.

If children nodes are detected as variable, this schema is marked for special processing of the children nodes so they don’t get removed from the result (in case of optional field specified by missing=drop) nor raise colander.Invalid because they are supposed to be colander.required.

Note

Because mapping schema deserialization is normally processed by validating the content of a sub-node according to its name, it is not possible to use the normal approach (i.e.: get dictionary value under matching key-name and validate it against the sub-schema of same name). We must verify against every variable node available in the mapping (also ignoring constants nodes with explicitly named keys), then guess a valid match and finally return it with modified name corresponding to the expected variable value in the parent mapping schema. Returning this modified name with variable makes the value/sub-schema correspondence transparent to the parent mapping when dictionary get-by-key is called during the mapping validation.

Warning

Because of the above reversed-processing method, all mapping nodes must derive from VariableSchemaNode to ensure they pre-process potential variable candidates.

_get_sub_variable(self, subnodes)[source]
deserialize(self, cstruct)[source]

Deserialize the cstruct into an appstruct based on the schema, run this appstruct through the preparer, if one is present, then validate the prepared appstruct. The cstruct value is deserialized into an appstruct unconditionally.

If appstruct returned by type deserialization and preparation is the value colander.null, do something special before attempting validation:

  • If the missing attribute of this node has been set explicitly, return its value. No validation of this value is performed; it is simply returned.

  • If the missing attribute of this node has not been set explicitly, raise a colander.Invalid exception error.

If the appstruct is not colander.null and cannot be validated , a colander.Invalid exception will be raised.

If a cstruct argument is not explicitly provided, it defaults to colander.null.

_deserialize_impl(self, cstruct)[source]
class weaver.wps_restapi.colander_extras.ExtendedSchemaNode(*args, **kwargs)[source]

Combines all colander.SchemaNode extensions so that default keyword is used first to resolve a missing field value during deserialize() call, and then removes the node completely if no default was provided, and evaluate variables as needed.

_extension = _ext_combined[source]
abstract static schema_type()[source]
_deserialize_extensions(self, cstruct)[source]
deserialize(self, cstruct)[source]

Deserialize the cstruct into an appstruct based on the schema, run this appstruct through the preparer, if one is present, then validate the prepared appstruct. The cstruct value is deserialized into an appstruct unconditionally.

If appstruct returned by type deserialization and preparation is the value colander.null, do something special before attempting validation:

  • If the missing attribute of this node has been set explicitly, return its value. No validation of this value is performed; it is simply returned.

  • If the missing attribute of this node has not been set explicitly, raise a colander.Invalid exception error.

If the appstruct is not colander.null and cannot be validated , a colander.Invalid exception will be raised.

If a cstruct argument is not explicitly provided, it defaults to colander.null.

class weaver.wps_restapi.colander_extras.DropableSequenceSchema(*args, **kwargs)[source]

Extends colander.SequenceSchema to auto-handle dropping missing entry definitions when its value is either None, colander.null or colander.drop.

schema_type[source]
class weaver.wps_restapi.colander_extras.DefaultSequenceSchema(*args, **kwargs)[source]

Extends colander.SequenceSchema to auto-handle replacing the result using the provided default value when the deserialization results into a sequence that should normally be dropped.

schema_type[source]
class weaver.wps_restapi.colander_extras.ExtendedSequenceSchema(*args, **kwargs)[source]

Combines DefaultSequenceSchema and DefaultSequenceSchema extensions so that default keyword is used first to resolve a missing sequence during deserialize() call, and then removes the node completely if no default was provided.

schema_type[source]
_validate(self)[source]
class weaver.wps_restapi.colander_extras.DropableMappingSchema(*args, **kwargs)[source]

Override the default colander.MappingSchema to auto-handle dropping missing field definitions when the corresponding value is either None, colander.null or colander.drop.

schema_type[source]
class weaver.wps_restapi.colander_extras.DefaultMappingSchema(*args, **kwargs)[source]

Override the default colander.MappingSchema to auto-handle replacing missing entries by their specified default during deserialization.

schema_type[source]
class weaver.wps_restapi.colander_extras.VariableMappingSchema(*args, **kwargs)[source]

Override the default colander.MappingSchema to auto-handle replacing missing entries by their specified variable during deserialization.

schema_type[source]
class weaver.wps_restapi.colander_extras.ExtendedMappingSchema(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

schema_type[source]
_validate_nodes(self)[source]
class weaver.wps_restapi.colander_extras.PermissiveMappingSchema(*args, **kwargs)[source]

Object schema that will allow any unknown field to remain present in the resulting deserialization.

This type is useful for defining a dictionary where some field names are not known in advance, or when more optional keys that don’t need to all be exhaustively provided in the schema are acceptable.

When doing schema deserialization to validate it, unknown keys would normally be removed without this class (default behaviour is to ignore them). With this schema, content under an unknown key is preserved as it was received without any validation. Other fields that are explicitly specified with sub-schema nodes will still be validated as per usual behaviour.

Example:

class AnyKeyObject(PermissiveMappingSchema):
    known_key = SchemaNode(String())

AnyKeyObject().deserialize({"unknown": "kept", "known_key": "requirement"}))
# result: dictionary returned as is instead of removing 'unknown' entry
#         'known_key' is still validated with its string schema

Note

This class is only a shorthand definition of unknown keyword for convenience. All colander.MappingSchema support this natively.

class weaver.wps_restapi.colander_extras.KeywordMapper(*args, **kwargs)[source]

Generic keyword mapper for any sub-implementers.

Allows specifying multiple combinations of schemas variants for an underlying schema definition. Each implementer must provide the corresponding keyword it defines amongst OpenAPI specification keywords.

schema_type[source]
_keyword_schemas_only_object = False[source]
_keyword_schemas_same_struct = False[source]
_keywords[source]
_keyword_map[source]
_keyword_inv[source]
_keyword :str[source]
classmethod get_keyword_name(cls)[source]
get_keyword_items(self)[source]
_validate_keyword_unique(self)[source]
_validate_keyword_schemas(self)[source]

Validation of children schemas under keyword.

Validation of keyword sub-nodes to be only defined as schema objects if property _keyword_schemas_only_object = True (i.e.: any node that defines its schema type as Mapping).

Validation of keyword sub-nodes to all have matching structure of container if _keyword_schemas_same_struct = True (i.e.: all colander.Mapping, all literal schema-types, etc.).

abstract _deserialize_keyword(self, cstruct)[source]

This method must be implemented by the specific keyword to handle invalid subnodes according to the behaviour it offers.

_deserialize_subnode(self, node, cstruct)[source]

This method must be called by keyword deserialization implementers for deserialization of every sub-node in order to apply extended behaviour operations accordingly. The original deserialize method of colander schema nodes should not be called directly, otherwise extensions will not be handled. This method will call it after resolving any applicable extension.

Note

Because sub-nodes are within a non-schema node iterable, the SchemaMeta will not have extracted the destination name for us (ie: map key to compare against). Furthermore, the destination is not directly in the KeywordMapper class, but in its parent where its instance will be dumped according to the keyword resolution. Therefore, regardless of the child, they all have the same parent destination.

deserialize(self, cstruct)[source]

Deserialize the cstruct into an appstruct based on the schema, run this appstruct through the preparer, if one is present, then validate the prepared appstruct. The cstruct value is deserialized into an appstruct unconditionally.

If appstruct returned by type deserialization and preparation is the value colander.null, do something special before attempting validation:

  • If the missing attribute of this node has been set explicitly, return its value. No validation of this value is performed; it is simply returned.

  • If the missing attribute of this node has not been set explicitly, raise a colander.Invalid exception error.

If the appstruct is not colander.null and cannot be validated , a colander.Invalid exception will be raised.

If a cstruct argument is not explicitly provided, it defaults to colander.null.

class weaver.wps_restapi.colander_extras.OneOfKeywordSchema(*args, **kwargs)[source]

Allows specifying multiple supported mapping schemas variants for an underlying schema definition. Corresponds to the oneOf specifier of OpenAPI specification.

Example:

class Variant1(MappingSchema):
    [...fields of Variant1...]

class Variant2(MappingSchema):
    [...fields of Variant2...]

class RequiredByBoth(MappingSchema):
    [...fields required by both Variant1 and Variant2...]

class OneOfWithRequiredFields(OneOfKeywordSchema, RequiredByBoth):
    _one_of = (Variant1, Variant2)
    [...alternatively, field required by all variants here...]

In the above example, the validation (ie: deserialize) process will succeed if only one of the _one_of variants’ validator completely succeed, and will fail if every variant fails validation execution. The operation will also fail if more than one validation succeeds.

Note

Class OneOfWithRequiredFields in the example is a shortcut variant to generate a specification that represents the pseudo-code oneOf([<list-of-objects-with-same-base>]).

The real OpenAPI method to implement the above very commonly occurring situation is as presented by the following pseudo-code:

oneOf[allOf[RequiredByBoth, Variant1], allOf[RequiredByBoth, Variant2]]

This is both painful to read and is a lot of extra code to write when you actually expand it all into classes (each oneOf/allOf is another class). Class OneOfKeywordSchema will actually simplify this by automatically making the allOf definitions for you if it detects other schema nodes than oneOf specified in the class bases. You can still do the full oneOf/allOf classes expansion manually though, it will result into the same specification.

Warning

When oneOf/allOf automatic expansion occurs during schema generation

Warning

When calling deserialize(), because the validation process requires exactly one of the variants to succeed to consider the whole object to evaluate as valid, it is important to insert more permissive validators later in the _one_of iterator (or validator keyword). For example, having a variant with all fields defined as optional (ie: with missing=drop) inserted as first item in _one_of will make it always succeed regardless of following variants (since an empty schema with everything dropped is valid for optional-only elements). This would have as side effect of potentially failing the validation if other object are also valid depending on the received schema because the schema cannot be discriminated between many. If this occurs, it means the your schemas are too permissive.

In the event that you have very similar schemas that can sometime match except one identifier (e.g.: field type defining the type of object), consider adding a validator to each sub-node with explicit values to solve the discrimination problem.

As a shortcut, the OpenAPI keyword discriminator can be provided to try matching as a last resort.

For example:

class Animal(ExtendedMappingSchema):
    name = ExtendedSchemaNode(String())
    type = ExtendedSchemaNode(String())  # with explicit definition, this shouldn't be here

    ## With explicit definitions, each below 'Animal' class should be defined as follows
    ## type = ExtendedSchemaNode(String(), validator=colander.OneOf(['<animal>']))

class Cat(Animal):
    [...]   # many **OPTIONAL** fields

class Dog(Animal):
    [...]   # many **OPTIONAL** fields

# With the discriminator keyword, following is possible
class SomeAnimal(OneOfMappingSchema):
    discriminator = {
        "propertyName": "type",     # correspond to 'type' of 'Animal'
        "mapping": {
            "cat": Cat, "dog": Dog  # map expected values to target schemas
        }
    }
    _one_of = [
        Cat(),
        Dog(),
    ]

Note

Keyword discriminator supports a map of key-string to schemas-type as presented in the example, and the key must be located at the top level of the mapping. If only discriminator = "<field>" is provided, the definition will be created automatically using the example (which should be only the matching value) of the corresponding field of each node within the _one_of mapping.

When multiple valid schemas are matched against the input data, the error will be raised and returned with corresponding erroneous elements for each sub-schema (fully listed).

_keyword_schemas_only_object = False[source]
_keyword = _one_of[source]
_discriminator = discriminator[source]
abstract classmethod _one_of(cls)Iterable[Union[colander.SchemaNode, Type[colander.SchemaNode]]][source]

This must be overridden in the schema definition using it.

property discriminator_spec(self)[source]
_deserialize_keyword(self, cstruct)[source]

Test each possible case, return all corresponding errors if none of the possibilities is valid including all sub-dependencies.

class weaver.wps_restapi.colander_extras.AllOfKeywordSchema(*args, **kwargs)[source]

Allows specifying all the required partial mapping schemas for an underlying complete schema definition. Corresponds to the allOf specifier of OpenAPI specification.

Example:

class RequiredItem(ExtendedMappingSchema):
    item = ExtendedSchemaNode(String())

class RequiredType(ExtendedMappingSchema):
    type = ExtendedSchemaNode(String())

class AllRequired(AnyKeywordSchema):
    _all_of = [RequiredItem(), RequiredType()]

Value parsed with schema this definition will be valid only when every since one of the sub-schemas is valid. Any sub-schema raising an invalid error for any reason with make the whole schema validation fail.

_keyword_schemas_only_object = True[source]
_keyword_schemas_same_struct = True[source]
_keyword = _all_of[source]
abstract classmethod _all_of(cls)Iterable[Union[colander.SchemaNode, Type[colander.SchemaNode]]][source]

This must be overridden in the schema definition using it.

_deserialize_keyword(self, cstruct)[source]

Test each possible case, return all corresponding errors if any of the possibilities is invalid.

class weaver.wps_restapi.colander_extras.AnyOfKeywordSchema(*args, **kwargs)[source]

Allows specifying all mapping schemas that can be matched for an underlying schema definition. Corresponds to the anyOf specifier of OpenAPI specification.

Contrary to OneOfKeywordSchema that MUST be validated with exactly one schema, this definition will continue parsing all possibilities and apply validated sub-schemas on top of each other. Not all schemas have to be valid like in the case of AllOfKeywordSchema to succeed, as long as at least one of them is valid.

Example:

class RequiredItem(ExtendedMappingSchema):
    item = ExtendedSchemaNode(String())

class RequiredType(ExtendedMappingSchema):
    type = ExtendedSchemaNode(String())

class RequiredFields(ExtendedMappingSchema):
    field_str = ExtendedSchemaNode(String())
    field_int = ExtendedSchemaNode(Integer())

class AnyRequired(AnyKeywordSchema):
    _any_of = [RequiredItem(), RequiredType(), RequiredFields()]

# following is valid because their individual parts have all required sub-fields, result is their composition
AnyRequired().deserialize({"type": "test", "item": "valid"})     # result: {"type": "test", "item": "valid"}

# following is also valid because even though 'item' is missing, the 'type' is present
AnyRequired().deserialize({"type": "test"})                      # result: {"type": "test"}

# following is invalid because every one of the sub-field of individual parts are missing
AnyRequired().deserialize({"type": "test"})

# following is invalid because fields of 'RequiredFields' are only partially fulfilled
AnyRequired().deserialize({"field_str": "str"})

# following is valid because although fields of 'RequiredFields' are not all fulfilled, 'RequiredType' is valid
AnyRequired().deserialize({"field_str": "str", "type": "str"})  # result: {"type": "test"}

# following is invalid because 'RequiredFields' field 'field_int' is incorrect schema type
AnyRequired().deserialize({"field_str": "str", "field_int": "str"})

# following is valid, but result omits 'type' because its schema-type is incorrect, while others are valid
AnyRequired().deserialize({"field_str": "str", "field_int": 1, "items": "fields", "type": 1})
# result: {"field_str": "str", "field_int": 1, "items": "fields"}

Warning

Because valid items are applied on top of each other by merging fields during combinations, conflicting field names of any valid schema will contain only the final valid parsing during deserialization.

_keyword_schemas_only_object = False[source]
_keyword_schemas_same_struct = True[source]
_keyword = _any_of[source]
abstract classmethod _any_of(cls)Iterable[Union[colander.SchemaNode, Type[colander.SchemaNode]]][source]

This must be overridden in the schema definition using it.

_deserialize_keyword(self, cstruct)[source]

Test each possible case, return if no corresponding schema was found.

class weaver.wps_restapi.colander_extras.NotKeywordSchema(*args, **kwargs)[source]

Allows specifying specific schema conditions that fails underlying schema definition validation if present.

Corresponds to the not specifier of OpenAPI specification.

This is equivalent to OpenAPI object mapping with additionalProperties: false, but is more explicit in the definition of invalid or conflicting field names with explicit definitions during deserialization.

Example:

class RequiredItem(ExtendedMappingSchema):
    item = ExtendedSchemaNode(String())

class MappingWithType(ExtendedMappingSchema):
    type = ExtendedSchemaNode(String())

class MappingWithoutType(NotKeywordSchema, RequiredItem):
    _not = [MappingWithType()]

class MappingOnlyNotType(NotKeywordSchema):
    _not = [MappingWithType()]

# following will raise invalid error even if 'item' is valid because 'type' is also present
MappingWithoutType().deserialize({"type": "invalid", "item": "valid"})

# following will return successfully with only 'item' because 'type' was not present
MappingWithoutType().deserialize({"item": "valid", "value": "ignore"})
# result: {"item": "valid"}

# following will return an empty mapping dropping 'item' since it only needs to ensure 'type' was not present,
# but did not provide any additional fields requirement from other class inheritances
MappingOnlyNotType().deserialize({"item": "valid"})
# result: {}
_keyword_schemas_only_object = True[source]
_keyword_schemas_same_struct = True[source]
_keyword = _not[source]
abstract classmethod _not(cls)Iterable[Union[colander.SchemaNode, Type[colander.SchemaNode]]][source]

This must be overridden in the schema definition using it.

_deserialize_keyword(self, cstruct)[source]

Raise if any sub-node schema that should NOT be present was successfully validated.

class weaver.wps_restapi.colander_extras.KeywordTypeConverter(dispatcher)[source]

Generic keyword converter that builds schema with a list of sub-schemas under the keyword.

convert_type(self, schema_node)[source]
class weaver.wps_restapi.colander_extras.OneOfKeywordTypeConverter(dispatcher)[source]

Object converter that generates the oneOf keyword definition.

This object does a bit more work than other KeywordTypeConverter as it handles the shorthand definition as described in OneOfKeywordSchema

convert_type(self: OneOfKeywordSchema, schema_node)Dict[source]
class weaver.wps_restapi.colander_extras.AllOfKeywordTypeConverter(dispatcher)[source]

Object converter that generates the allOf keyword definition.

class weaver.wps_restapi.colander_extras.AnyOfKeywordTypeConverter(dispatcher)[source]

Object converter that generates the anyOf keyword definition.

class weaver.wps_restapi.colander_extras.NotKeywordTypeConverter(dispatcher)[source]

Object converter that generates the not keyword definition.

convert_type(self, schema_node)[source]
class weaver.wps_restapi.colander_extras.VariableObjectTypeConverter(dispatcher)[source]

Updates the mapping object’s additionalProperties for each properties that a marked as VariableSchemaNode.

convert_type(self, schema_node)[source]
class weaver.wps_restapi.colander_extras.OAS3TypeConversionDispatcher(custom_converters=None, default_converter=None)[source]
openapi_spec = 3[source]
weaver.wps_restapi.colander_extras._make_node_instance(schema_node_or_class: Union[colander.SchemaNode, Type[colander.SchemaNode]])colander.SchemaNode[source]

Obtains a schema node instance in case it was specified only by type reference.

This helps being more permissive of provided definitions while handling situations like presented in the example below:

class Map(OneOfMappingSchema):
    # uses types instead of instances like 'SubMap1([...])' and 'SubMap2([...])'
    _one_of = (SubMap1, SubMap2)
weaver.wps_restapi.colander_extras._get_schema_type(schema_node: Union[colander.SchemaNode, Type[colander.SchemaNode]], check: bool = False)Optional[colander.SchemaType][source]

Obtains the schema-type from the provided node, supporting various initialization methods.

  • typ is set by an instantiated node from specific schema (e.g.: colander.SchemaNode(colander.String()))

  • schema_type can also be provided, either by type or instance if using class definition with property

Parameters
  • schema_node – item to analyse

  • check – only attempt to retrieve the schema type, and if failing return None

Returns

found schema type

Raises

ConversionTypeError – if no check requested and schema type cannot be found (invalid schema node)

weaver.wps_restapi.colander_extras._get_node_name(schema_node: colander.SchemaNode, schema_name: bool = False)str[source]

Obtains the name of the node with best available value.

Parameters
  • schema_node – node for which to retrieve the name.

  • schema_name

    • If True, prefer the schema definition (class) name over the instance or field name.

    • Otherwise, return the field name, the title or as last result the class name.

Returns

node name

weaver.wps_restapi.swagger_definitions

This module should contain any and every definitions in use to build the swagger UI, so that one can update the swagger without touching any other files after the initial integration

Module Contents
weaver.wps_restapi.swagger_definitions.ViewInfo[source]
weaver.wps_restapi.swagger_definitions.API_TITLE = Weaver REST API[source]
weaver.wps_restapi.swagger_definitions.API_INFO[source]
weaver.wps_restapi.swagger_definitions.API_DOCS[source]
weaver.wps_restapi.swagger_definitions.DOC_URL[source]
weaver.wps_restapi.swagger_definitions.CWL_VERSION = v1.1[source]
weaver.wps_restapi.swagger_definitions.CWL_REPO_URL = https://github.com/common-workflow-language[source]
weaver.wps_restapi.swagger_definitions.CWL_BASE_URL = https://www.commonwl.org[source]
weaver.wps_restapi.swagger_definitions.CWL_SPEC_URL[source]
weaver.wps_restapi.swagger_definitions.CWL_USER_GUIDE_URL[source]
weaver.wps_restapi.swagger_definitions.CWL_CMD_TOOL_URL[source]
weaver.wps_restapi.swagger_definitions.CWL_WORKFLOW_URL[source]
weaver.wps_restapi.swagger_definitions.CWL_DOC_MESSAGE[source]
weaver.wps_restapi.swagger_definitions.IO_INFO_IDS = Identifier of the {first} {what}. To merge details between corresponding {first} and {second}...[source]
weaver.wps_restapi.swagger_definitions.OGC_API_REPO_URL = https://github.com/opengeospatial/ogcapi-processes[source]
weaver.wps_restapi.swagger_definitions.OGC_API_SCHEMA_URL = https://raw.githubusercontent.com/opengeospatial/ogcapi-processes[source]
weaver.wps_restapi.swagger_definitions.DATETIME_INTERVAL_CLOSED_SYMBOL = /[source]
weaver.wps_restapi.swagger_definitions.DATETIME_INTERVAL_OPEN_START_SYMBOL = ../[source]
weaver.wps_restapi.swagger_definitions.DATETIME_INTERVAL_OPEN_END_SYMBOL = /..[source]
weaver.wps_restapi.swagger_definitions.SCHEMA_EXAMPLE_DIR[source]
weaver.wps_restapi.swagger_definitions.EXAMPLES[source]
weaver.wps_restapi.swagger_definitions.path[source]
weaver.wps_restapi.swagger_definitions.TAG_API = API[source]
weaver.wps_restapi.swagger_definitions.TAG_JOBS = Jobs[source]
weaver.wps_restapi.swagger_definitions.TAG_VISIBILITY = Visibility[source]
weaver.wps_restapi.swagger_definitions.TAG_BILL_QUOTE = Billing & Quoting[source]
weaver.wps_restapi.swagger_definitions.TAG_PROVIDERS = Providers[source]
weaver.wps_restapi.swagger_definitions.TAG_PROCESSES = Processes[source]
weaver.wps_restapi.swagger_definitions.TAG_GETCAPABILITIES = GetCapabilities[source]
weaver.wps_restapi.swagger_definitions.TAG_DESCRIBEPROCESS = DescribeProcess[source]
weaver.wps_restapi.swagger_definitions.TAG_EXECUTE = Execute[source]
weaver.wps_restapi.swagger_definitions.TAG_DISMISS = Dismiss[source]
weaver.wps_restapi.swagger_definitions.TAG_STATUS = Status[source]
weaver.wps_restapi.swagger_definitions.TAG_DEPLOY = Deploy[source]
weaver.wps_restapi.swagger_definitions.TAG_RESULTS = Results[source]
weaver.wps_restapi.swagger_definitions.TAG_EXCEPTIONS = Exceptions[source]
weaver.wps_restapi.swagger_definitions.TAG_LOGS = Logs[source]
weaver.wps_restapi.swagger_definitions.TAG_WPS = WPS[source]
weaver.wps_restapi.swagger_definitions.TAG_DEPRECATED = Deprecated Endpoints[source]
weaver.wps_restapi.swagger_definitions.api_frontpage_service[source]
weaver.wps_restapi.swagger_definitions.api_openapi_ui_service[source]
weaver.wps_restapi.swagger_definitions.api_swagger_ui_service[source]
weaver.wps_restapi.swagger_definitions.api_redoc_ui_service[source]
weaver.wps_restapi.swagger_definitions.api_versions_service[source]
weaver.wps_restapi.swagger_definitions.api_conformance_service[source]
weaver.wps_restapi.swagger_definitions.openapi_json_service[source]
weaver.wps_restapi.swagger_definitions.quotes_service[source]
weaver.wps_restapi.swagger_definitions.quote_service[source]
weaver.wps_restapi.swagger_definitions.bills_service[source]
weaver.wps_restapi.swagger_definitions.bill_service[source]
weaver.wps_restapi.swagger_definitions.jobs_service[source]
weaver.wps_restapi.swagger_definitions.job_service[source]
weaver.wps_restapi.swagger_definitions.job_results_service[source]
weaver.wps_restapi.swagger_definitions.job_exceptions_service[source]
weaver.wps_restapi.swagger_definitions.job_outputs_service[source]
weaver.wps_restapi.swagger_definitions.job_inputs_service[source]
weaver.wps_restapi.swagger_definitions.job_logs_service[source]
weaver.wps_restapi.swagger_definitions.processes_service[source]
weaver.wps_restapi.swagger_definitions.process_service[source]
weaver.wps_restapi.swagger_definitions.process_quotes_service[source]
weaver.wps_restapi.swagger_definitions.process_quote_service[source]
weaver.wps_restapi.swagger_definitions.process_visibility_service[source]
weaver.wps_restapi.swagger_definitions.process_package_service[source]
weaver.wps_restapi.swagger_definitions.process_payload_service[source]
weaver.wps_restapi.swagger_definitions.process_jobs_service[source]
weaver.wps_restapi.swagger_definitions.process_job_service[source]
weaver.wps_restapi.swagger_definitions.process_results_service[source]
weaver.wps_restapi.swagger_definitions.process_inputs_service[source]
weaver.wps_restapi.swagger_definitions.process_outputs_service[source]
weaver.wps_restapi.swagger_definitions.process_exceptions_service[source]
weaver.wps_restapi.swagger_definitions.process_logs_service[source]
weaver.wps_restapi.swagger_definitions.process_execution_service[source]
weaver.wps_restapi.swagger_definitions.providers_service[source]
weaver.wps_restapi.swagger_definitions.provider_service[source]
weaver.wps_restapi.swagger_definitions.provider_processes_service[source]
weaver.wps_restapi.swagger_definitions.provider_process_service[source]
weaver.wps_restapi.swagger_definitions.provider_jobs_service[source]
weaver.wps_restapi.swagger_definitions.provider_job_service[source]
weaver.wps_restapi.swagger_definitions.provider_results_service[source]
weaver.wps_restapi.swagger_definitions.provider_inputs_service[source]
weaver.wps_restapi.swagger_definitions.provider_outputs_service[source]
weaver.wps_restapi.swagger_definitions.provider_logs_service[source]
weaver.wps_restapi.swagger_definitions.provider_exceptions_service[source]
weaver.wps_restapi.swagger_definitions.job_result_service[source]
weaver.wps_restapi.swagger_definitions.process_result_service[source]
weaver.wps_restapi.swagger_definitions.provider_result_service[source]
class weaver.wps_restapi.swagger_definitions.SLUG(*args, **kwargs)[source]

Combines all colander.SchemaNode extensions so that default keyword is used first to resolve a missing field value during deserialize() call, and then removes the node completely if no default was provided, and evaluate variables as needed.

See also

  • ExtendedMappingSchema

  • ExtendedSequenceSchema

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

schema_type[source]
description = Slug name pattern.[source]
example = some-object-slug-name[source]
pattern = ^[A-Za-z0-9]+(?:(-|_)[A-Za-z0-9]+)*$[source]
class weaver.wps_restapi.swagger_definitions.URL(*args, **kwargs)[source]

Combines all colander.SchemaNode extensions so that default keyword is used first to resolve a missing field value during deserialize() call, and then removes the node completely if no default was provided, and evaluate variables as needed.

See also

  • ExtendedMappingSchema

  • ExtendedSequenceSchema

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

schema_type[source]
description = URL reference.[source]
format = url[source]
class weaver.wps_restapi.swagger_definitions.DateTimeInterval(*args, **kwargs)[source]

Combines all colander.SchemaNode extensions so that default keyword is used first to resolve a missing field value during deserialize() call, and then removes the node completely if no default was provided, and evaluate variables as needed.

See also

  • ExtendedMappingSchema

  • ExtendedSequenceSchema

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

schema_type[source]
description = DateTime format against OGC-API - Processes, to get values before a certain date-time use '../'...[source]
example = 2022-03-02T03:32:38.487000+00:00/..[source]
regex_datetime = (\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(\.\d+)?(([+-]\d\d:\d\d)|Z)?)[source]
regex_interval_closed[source]
regex_interval_open_start[source]
regex_interval_open_end[source]
pattern[source]
class weaver.wps_restapi.swagger_definitions.S3Bucket(*args, **kwargs)[source]

Combines all colander.SchemaNode extensions so that default keyword is used first to resolve a missing field value during deserialize() call, and then removes the node completely if no default was provided, and evaluate variables as needed.

See also

  • ExtendedMappingSchema

  • ExtendedSequenceSchema

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

schema_type[source]
description = S3 bucket shorthand URL representation [s3://<bucket>/<job-uuid>/<output>.ext][source]
pattern = ^s3://\S+$[source]
class weaver.wps_restapi.swagger_definitions.FileLocal(*args, **kwargs)[source]

Combines all colander.SchemaNode extensions so that default keyword is used first to resolve a missing field value during deserialize() call, and then removes the node completely if no default was provided, and evaluate variables as needed.

See also

  • ExtendedMappingSchema

  • ExtendedSequenceSchema

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

schema_type[source]
description = Local file reference.[source]
format = file[source]
validator[source]
class weaver.wps_restapi.swagger_definitions.FileURL(*args, **kwargs)[source]

Combines all colander.SchemaNode extensions so that default keyword is used first to resolve a missing field value during deserialize() call, and then removes the node completely if no default was provided, and evaluate variables as needed.

See also

  • ExtendedMappingSchema

  • ExtendedSequenceSchema

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

schema_type[source]
description = URL file reference.[source]
format = url[source]
validator[source]
class weaver.wps_restapi.swagger_definitions.ReferenceURL(*args, **kwargs)[source]

Allows specifying all mapping schemas that can be matched for an underlying schema definition. Corresponds to the anyOf specifier of OpenAPI specification.

Contrary to OneOfKeywordSchema that MUST be validated with exactly one schema, this definition will continue parsing all possibilities and apply validated sub-schemas on top of each other. Not all schemas have to be valid like in the case of AllOfKeywordSchema to succeed, as long as at least one of them is valid.

Example:

class RequiredItem(ExtendedMappingSchema):
    item = ExtendedSchemaNode(String())

class RequiredType(ExtendedMappingSchema):
    type = ExtendedSchemaNode(String())

class RequiredFields(ExtendedMappingSchema):
    field_str = ExtendedSchemaNode(String())
    field_int = ExtendedSchemaNode(Integer())

class AnyRequired(AnyKeywordSchema):
    _any_of = [RequiredItem(), RequiredType(), RequiredFields()]

# following is valid because their individual parts have all required sub-fields, result is their composition
AnyRequired().deserialize({"type": "test", "item": "valid"})     # result: {"type": "test", "item": "valid"}

# following is also valid because even though 'item' is missing, the 'type' is present
AnyRequired().deserialize({"type": "test"})                      # result: {"type": "test"}

# following is invalid because every one of the sub-field of individual parts are missing
AnyRequired().deserialize({"type": "test"})

# following is invalid because fields of 'RequiredFields' are only partially fulfilled
AnyRequired().deserialize({"field_str": "str"})

# following is valid because although fields of 'RequiredFields' are not all fulfilled, 'RequiredType' is valid
AnyRequired().deserialize({"field_str": "str", "type": "str"})  # result: {"type": "test"}

# following is invalid because 'RequiredFields' field 'field_int' is incorrect schema type
AnyRequired().deserialize({"field_str": "str", "field_int": "str"})

# following is valid, but result omits 'type' because its schema-type is incorrect, while others are valid
AnyRequired().deserialize({"field_str": "str", "field_int": 1, "items": "fields", "type": 1})
# result: {"field_str": "str", "field_int": 1, "items": "fields"}

Warning

Because valid items are applied on top of each other by merging fields during combinations, conflicting field names of any valid schema will contain only the final valid parsing during deserialization.

See also

  • OneOfKeywordSchema

  • AllOfKeywordSchema

  • NotKeywordSchema

_any_of[source]
class weaver.wps_restapi.swagger_definitions.UUID(*args, **kwargs)[source]

Combines all colander.SchemaNode extensions so that default keyword is used first to resolve a missing field value during deserialize() call, and then removes the node completely if no default was provided, and evaluate variables as needed.

See also

  • ExtendedMappingSchema

  • ExtendedSequenceSchema

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

schema_type[source]
description = Unique identifier.[source]
example = a9d14bf4-84e0-449a-bac8-16e598efe807[source]
format = uuid[source]
title = UUID[source]
class weaver.wps_restapi.swagger_definitions.AnyIdentifier(*args, **kwargs)[source]

Combines all colander.SchemaNode extensions so that default keyword is used first to resolve a missing field value during deserialize() call, and then removes the node completely if no default was provided, and evaluate variables as needed.

See also

  • ExtendedMappingSchema

  • ExtendedSequenceSchema

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

class weaver.wps_restapi.swagger_definitions.ProcessIdentifier(*args, **kwargs)[source]

Allows specifying all mapping schemas that can be matched for an underlying schema definition. Corresponds to the anyOf specifier of OpenAPI specification.

Contrary to OneOfKeywordSchema that MUST be validated with exactly one schema, this definition will continue parsing all possibilities and apply validated sub-schemas on top of each other. Not all schemas have to be valid like in the case of AllOfKeywordSchema to succeed, as long as at least one of them is valid.

Example:

class RequiredItem(ExtendedMappingSchema):
    item = ExtendedSchemaNode(String())

class RequiredType(ExtendedMappingSchema):
    type = ExtendedSchemaNode(String())

class RequiredFields(ExtendedMappingSchema):
    field_str = ExtendedSchemaNode(String())
    field_int = ExtendedSchemaNode(Integer())

class AnyRequired(AnyKeywordSchema):
    _any_of = [RequiredItem(), RequiredType(), RequiredFields()]

# following is valid because their individual parts have all required sub-fields, result is their composition
AnyRequired().deserialize({"type": "test", "item": "valid"})     # result: {"type": "test", "item": "valid"}

# following is also valid because even though 'item' is missing, the 'type' is present
AnyRequired().deserialize({"type": "test"})                      # result: {"type": "test"}

# following is invalid because every one of the sub-field of individual parts are missing
AnyRequired().deserialize({"type": "test"})

# following is invalid because fields of 'RequiredFields' are only partially fulfilled
AnyRequired().deserialize({"field_str": "str"})

# following is valid because although fields of 'RequiredFields' are not all fulfilled, 'RequiredType' is valid
AnyRequired().deserialize({"field_str": "str", "type": "str"})  # result: {"type": "test"}

# following is invalid because 'RequiredFields' field 'field_int' is incorrect schema type
AnyRequired().deserialize({"field_str": "str", "field_int": "str"})

# following is valid, but result omits 'type' because its schema-type is incorrect, while others are valid
AnyRequired().deserialize({"field_str": "str", "field_int": 1, "items": "fields", "type": 1})
# result: {"field_str": "str", "field_int": 1, "items": "fields"}

Warning

Because valid items are applied on top of each other by merging fields during combinations, conflicting field names of any valid schema will contain only the final valid parsing during deserialization.

See also

  • OneOfKeywordSchema

  • AllOfKeywordSchema

  • NotKeywordSchema

description = Process identifier.[source]
_any_of[source]
class weaver.wps_restapi.swagger_definitions.Version(*args, **kwargs)[source]

Combines all colander.SchemaNode extensions so that default keyword is used first to resolve a missing field value during deserialize() call, and then removes the node completely if no default was provided, and evaluate variables as needed.

See also

  • ExtendedMappingSchema

  • ExtendedSequenceSchema

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

schema_type[source]
description = Version string.[source]
example = 1.2.3[source]
validator[source]
class weaver.wps_restapi.swagger_definitions.ContentTypeHeader(*args, **kwargs)[source]

Combines all colander.SchemaNode extensions so that default keyword is used first to resolve a missing field value during deserialize() call, and then removes the node completely if no default was provided, and evaluate variables as needed.

See also

  • ExtendedMappingSchema

  • ExtendedSequenceSchema

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

name = Content-Type[source]
schema_type[source]
class weaver.wps_restapi.swagger_definitions.AcceptHeader(*args, **kwargs)[source]

Combines all colander.SchemaNode extensions so that default keyword is used first to resolve a missing field value during deserialize() call, and then removes the node completely if no default was provided, and evaluate variables as needed.

See also

  • ExtendedMappingSchema

  • ExtendedSequenceSchema

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

name = Accept[source]
schema_type[source]
validator[source]
missing[source]
default[source]
class weaver.wps_restapi.swagger_definitions.AcceptLanguageHeader(*args, **kwargs)[source]

Combines all colander.SchemaNode extensions so that default keyword is used first to resolve a missing field value during deserialize() call, and then removes the node completely if no default was provided, and evaluate variables as needed.

See also

  • ExtendedMappingSchema

  • ExtendedSequenceSchema

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

name = Accept-Language[source]
schema_type[source]
missing[source]
default[source]
class weaver.wps_restapi.swagger_definitions.JsonHeader(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

content_type[source]
class weaver.wps_restapi.swagger_definitions.HtmlHeader(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

content_type[source]
class weaver.wps_restapi.swagger_definitions.XmlHeader(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

content_type[source]
class weaver.wps_restapi.swagger_definitions.RequestContentTypeHeader(*args, **kwargs)[source]

Allows specifying multiple supported mapping schemas variants for an underlying schema definition. Corresponds to the oneOf specifier of OpenAPI specification.

Example:

class Variant1(MappingSchema):
    [...fields of Variant1...]

class Variant2(MappingSchema):
    [...fields of Variant2...]

class RequiredByBoth(MappingSchema):
    [...fields required by both Variant1 and Variant2...]

class OneOfWithRequiredFields(OneOfKeywordSchema, RequiredByBoth):
    _one_of = (Variant1, Variant2)
    [...alternatively, field required by all variants here...]

In the above example, the validation (ie: deserialize) process will succeed if only one of the _one_of variants’ validator completely succeed, and will fail if every variant fails validation execution. The operation will also fail if more than one validation succeeds.

Note

Class OneOfWithRequiredFields in the example is a shortcut variant to generate a specification that represents the pseudo-code oneOf([<list-of-objects-with-same-base>]).

The real OpenAPI method to implement the above very commonly occurring situation is as presented by the following pseudo-code:

oneOf[allOf[RequiredByBoth, Variant1], allOf[RequiredByBoth, Variant2]]

This is both painful to read and is a lot of extra code to write when you actually expand it all into classes (each oneOf/allOf is another class). Class OneOfKeywordSchema will actually simplify this by automatically making the allOf definitions for you if it detects other schema nodes than oneOf specified in the class bases. You can still do the full oneOf/allOf classes expansion manually though, it will result into the same specification.

Warning

When oneOf/allOf automatic expansion occurs during schema generation

Warning

When calling deserialize(), because the validation process requires exactly one of the variants to succeed to consider the whole object to evaluate as valid, it is important to insert more permissive validators later in the _one_of iterator (or validator keyword). For example, having a variant with all fields defined as optional (ie: with missing=drop) inserted as first item in _one_of will make it always succeed regardless of following variants (since an empty schema with everything dropped is valid for optional-only elements). This would have as side effect of potentially failing the validation if other object are also valid depending on the received schema because the schema cannot be discriminated between many. If this occurs, it means the your schemas are too permissive.

In the event that you have very similar schemas that can sometime match except one identifier (e.g.: field type defining the type of object), consider adding a validator to each sub-node with explicit values to solve the discrimination problem.

As a shortcut, the OpenAPI keyword discriminator can be provided to try matching as a last resort.

For example:

class Animal(ExtendedMappingSchema):
    name = ExtendedSchemaNode(String())
    type = ExtendedSchemaNode(String())  # with explicit definition, this shouldn't be here

    ## With explicit definitions, each below 'Animal' class should be defined as follows
    ## type = ExtendedSchemaNode(String(), validator=colander.OneOf(['<animal>']))

class Cat(Animal):
    [...]   # many **OPTIONAL** fields

class Dog(Animal):
    [...]   # many **OPTIONAL** fields

# With the discriminator keyword, following is possible
class SomeAnimal(OneOfMappingSchema):
    discriminator = {
        "propertyName": "type",     # correspond to 'type' of 'Animal'
        "mapping": {
            "cat": Cat, "dog": Dog  # map expected values to target schemas
        }
    }
    _one_of = [
        Cat(),
        Dog(),
    ]

Note

Keyword discriminator supports a map of key-string to schemas-type as presented in the example, and the key must be located at the top level of the mapping. If only discriminator = "<field>" is provided, the definition will be created automatically using the example (which should be only the matching value) of the corresponding field of each node within the _one_of mapping.

When multiple valid schemas are matched against the input data, the error will be raised and returned with corresponding erroneous elements for each sub-schema (fully listed).

See also

  • AllOfKeywordSchema

  • AnyOfKeywordSchema

  • NotKeywordSchema

_one_of[source]
class weaver.wps_restapi.swagger_definitions.ResponseContentTypeHeader(*args, **kwargs)[source]

Allows specifying multiple supported mapping schemas variants for an underlying schema definition. Corresponds to the oneOf specifier of OpenAPI specification.

Example:

class Variant1(MappingSchema):
    [...fields of Variant1...]

class Variant2(MappingSchema):
    [...fields of Variant2...]

class RequiredByBoth(MappingSchema):
    [...fields required by both Variant1 and Variant2...]

class OneOfWithRequiredFields(OneOfKeywordSchema, RequiredByBoth):
    _one_of = (Variant1, Variant2)
    [...alternatively, field required by all variants here...]

In the above example, the validation (ie: deserialize) process will succeed if only one of the _one_of variants’ validator completely succeed, and will fail if every variant fails validation execution. The operation will also fail if more than one validation succeeds.

Note

Class OneOfWithRequiredFields in the example is a shortcut variant to generate a specification that represents the pseudo-code oneOf([<list-of-objects-with-same-base>]).

The real OpenAPI method to implement the above very commonly occurring situation is as presented by the following pseudo-code:

oneOf[allOf[RequiredByBoth, Variant1], allOf[RequiredByBoth, Variant2]]

This is both painful to read and is a lot of extra code to write when you actually expand it all into classes (each oneOf/allOf is another class). Class OneOfKeywordSchema will actually simplify this by automatically making the allOf definitions for you if it detects other schema nodes than oneOf specified in the class bases. You can still do the full oneOf/allOf classes expansion manually though, it will result into the same specification.

Warning

When oneOf/allOf automatic expansion occurs during schema generation

Warning

When calling deserialize(), because the validation process requires exactly one of the variants to succeed to consider the whole object to evaluate as valid, it is important to insert more permissive validators later in the _one_of iterator (or validator keyword). For example, having a variant with all fields defined as optional (ie: with missing=drop) inserted as first item in _one_of will make it always succeed regardless of following variants (since an empty schema with everything dropped is valid for optional-only elements). This would have as side effect of potentially failing the validation if other object are also valid depending on the received schema because the schema cannot be discriminated between many. If this occurs, it means the your schemas are too permissive.

In the event that you have very similar schemas that can sometime match except one identifier (e.g.: field type defining the type of object), consider adding a validator to each sub-node with explicit values to solve the discrimination problem.

As a shortcut, the OpenAPI keyword discriminator can be provided to try matching as a last resort.

For example:

class Animal(ExtendedMappingSchema):
    name = ExtendedSchemaNode(String())
    type = ExtendedSchemaNode(String())  # with explicit definition, this shouldn't be here

    ## With explicit definitions, each below 'Animal' class should be defined as follows
    ## type = ExtendedSchemaNode(String(), validator=colander.OneOf(['<animal>']))

class Cat(Animal):
    [...]   # many **OPTIONAL** fields

class Dog(Animal):
    [...]   # many **OPTIONAL** fields

# With the discriminator keyword, following is possible
class SomeAnimal(OneOfMappingSchema):
    discriminator = {
        "propertyName": "type",     # correspond to 'type' of 'Animal'
        "mapping": {
            "cat": Cat, "dog": Dog  # map expected values to target schemas
        }
    }
    _one_of = [
        Cat(),
        Dog(),
    ]

Note

Keyword discriminator supports a map of key-string to schemas-type as presented in the example, and the key must be located at the top level of the mapping. If only discriminator = "<field>" is provided, the definition will be created automatically using the example (which should be only the matching value) of the corresponding field of each node within the _one_of mapping.

When multiple valid schemas are matched against the input data, the error will be raised and returned with corresponding erroneous elements for each sub-schema (fully listed).

See also

  • AllOfKeywordSchema

  • AnyOfKeywordSchema

  • NotKeywordSchema

_one_of[source]
class weaver.wps_restapi.swagger_definitions.RequestHeaders(*args, **kwargs)[source]

Headers that can indicate how to adjust the behavior and/or result the be provided in the response.

accept[source]
accept_language[source]
class weaver.wps_restapi.swagger_definitions.ResponseHeaders(*args, **kwargs)[source]

Headers describing resulting response.

class weaver.wps_restapi.swagger_definitions.RedirectHeaders(*args, **kwargs)[source]

Headers describing resulting response.

Location[source]
class weaver.wps_restapi.swagger_definitions.NoContent(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

description = Empty response body.[source]
default[source]
class weaver.wps_restapi.swagger_definitions.KeywordList(*args, **kwargs)[source]

Combines DefaultSequenceSchema and DefaultSequenceSchema extensions so that default keyword is used first to resolve a missing sequence during deserialize() call, and then removes the node completely if no default was provided.

See also

  • ExtendedSchemaNode

  • ExtendedMappingSchema

keyword[source]
class weaver.wps_restapi.swagger_definitions.Language(*args, **kwargs)[source]

Combines all colander.SchemaNode extensions so that default keyword is used first to resolve a missing field value during deserialize() call, and then removes the node completely if no default was provided, and evaluate variables as needed.

See also

  • ExtendedMappingSchema

  • ExtendedSequenceSchema

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

schema_type[source]
example[source]
validator[source]
class weaver.wps_restapi.swagger_definitions.ValueLanguage(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

lang[source]
class weaver.wps_restapi.swagger_definitions.LinkLanguage(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

hreflang[source]
class weaver.wps_restapi.swagger_definitions.MetadataBase(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

type[source]
title[source]
class weaver.wps_restapi.swagger_definitions.MetadataRole(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

role[source]
class weaver.wps_restapi.swagger_definitions.LinkRelationship(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

rel[source]
class weaver.wps_restapi.swagger_definitions.LinkBase(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

href[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

class weaver.wps_restapi.swagger_definitions.MetadataValue(*args, **kwargs)[source]

Allows specifying specific schema conditions that fails underlying schema definition validation if present.

Corresponds to the not specifier of OpenAPI specification.

This is equivalent to OpenAPI object mapping with additionalProperties: false, but is more explicit in the definition of invalid or conflicting field names with explicit definitions during deserialization.

Example:

class RequiredItem(ExtendedMappingSchema):
    item = ExtendedSchemaNode(String())

class MappingWithType(ExtendedMappingSchema):
    type = ExtendedSchemaNode(String())

class MappingWithoutType(NotKeywordSchema, RequiredItem):
    _not = [MappingWithType()]

class MappingOnlyNotType(NotKeywordSchema):
    _not = [MappingWithType()]

# following will raise invalid error even if 'item' is valid because 'type' is also present
MappingWithoutType().deserialize({"type": "invalid", "item": "valid"})

# following will return successfully with only 'item' because 'type' was not present
MappingWithoutType().deserialize({"item": "valid", "value": "ignore"})
# result: {"item": "valid"}

# following will return an empty mapping dropping 'item' since it only needs to ensure 'type' was not present,
# but did not provide any additional fields requirement from other class inheritances
MappingOnlyNotType().deserialize({"item": "valid"})
# result: {}

See also

  • OneOfKeywordSchema

  • AllOfKeywordSchema

  • AnyOfKeywordSchema

_not[source]
value[source]
class weaver.wps_restapi.swagger_definitions.MetadataContent(*args, **kwargs)[source]

Allows specifying multiple supported mapping schemas variants for an underlying schema definition. Corresponds to the oneOf specifier of OpenAPI specification.

Example:

class Variant1(MappingSchema):
    [...fields of Variant1...]

class Variant2(MappingSchema):
    [...fields of Variant2...]

class RequiredByBoth(MappingSchema):
    [...fields required by both Variant1 and Variant2...]

class OneOfWithRequiredFields(OneOfKeywordSchema, RequiredByBoth):
    _one_of = (Variant1, Variant2)
    [...alternatively, field required by all variants here...]

In the above example, the validation (ie: deserialize) process will succeed if only one of the _one_of variants’ validator completely succeed, and will fail if every variant fails validation execution. The operation will also fail if more than one validation succeeds.

Note

Class OneOfWithRequiredFields in the example is a shortcut variant to generate a specification that represents the pseudo-code oneOf([<list-of-objects-with-same-base>]).

The real OpenAPI method to implement the above very commonly occurring situation is as presented by the following pseudo-code:

oneOf[allOf[RequiredByBoth, Variant1], allOf[RequiredByBoth, Variant2]]

This is both painful to read and is a lot of extra code to write when you actually expand it all into classes (each oneOf/allOf is another class). Class OneOfKeywordSchema will actually simplify this by automatically making the allOf definitions for you if it detects other schema nodes than oneOf specified in the class bases. You can still do the full oneOf/allOf classes expansion manually though, it will result into the same specification.

Warning

When oneOf/allOf automatic expansion occurs during schema generation

Warning

When calling deserialize(), because the validation process requires exactly one of the variants to succeed to consider the whole object to evaluate as valid, it is important to insert more permissive validators later in the _one_of iterator (or validator keyword). For example, having a variant with all fields defined as optional (ie: with missing=drop) inserted as first item in _one_of will make it always succeed regardless of following variants (since an empty schema with everything dropped is valid for optional-only elements). This would have as side effect of potentially failing the validation if other object are also valid depending on the received schema because the schema cannot be discriminated between many. If this occurs, it means the your schemas are too permissive.

In the event that you have very similar schemas that can sometime match except one identifier (e.g.: field type defining the type of object), consider adding a validator to each sub-node with explicit values to solve the discrimination problem.

As a shortcut, the OpenAPI keyword discriminator can be provided to try matching as a last resort.

For example:

class Animal(ExtendedMappingSchema):
    name = ExtendedSchemaNode(String())
    type = ExtendedSchemaNode(String())  # with explicit definition, this shouldn't be here

    ## With explicit definitions, each below 'Animal' class should be defined as follows
    ## type = ExtendedSchemaNode(String(), validator=colander.OneOf(['<animal>']))

class Cat(Animal):
    [...]   # many **OPTIONAL** fields

class Dog(Animal):
    [...]   # many **OPTIONAL** fields

# With the discriminator keyword, following is possible
class SomeAnimal(OneOfMappingSchema):
    discriminator = {
        "propertyName": "type",     # correspond to 'type' of 'Animal'
        "mapping": {
            "cat": Cat, "dog": Dog  # map expected values to target schemas
        }
    }
    _one_of = [
        Cat(),
        Dog(),
    ]

Note

Keyword discriminator supports a map of key-string to schemas-type as presented in the example, and the key must be located at the top level of the mapping. If only discriminator = "<field>" is provided, the definition will be created automatically using the example (which should be only the matching value) of the corresponding field of each node within the _one_of mapping.

When multiple valid schemas are matched against the input data, the error will be raised and returned with corresponding erroneous elements for each sub-schema (fully listed).

See also

  • AllOfKeywordSchema

  • AnyOfKeywordSchema

  • NotKeywordSchema

_one_of[source]
class weaver.wps_restapi.swagger_definitions.Metadata(*args, **kwargs)[source]

Allows specifying multiple supported mapping schemas variants for an underlying schema definition. Corresponds to the oneOf specifier of OpenAPI specification.

Example:

class Variant1(MappingSchema):
    [...fields of Variant1...]

class Variant2(MappingSchema):
    [...fields of Variant2...]

class RequiredByBoth(MappingSchema):
    [...fields required by both Variant1 and Variant2...]

class OneOfWithRequiredFields(OneOfKeywordSchema, RequiredByBoth):
    _one_of = (Variant1, Variant2)
    [...alternatively, field required by all variants here...]

In the above example, the validation (ie: deserialize) process will succeed if only one of the _one_of variants’ validator completely succeed, and will fail if every variant fails validation execution. The operation will also fail if more than one validation succeeds.

Note

Class OneOfWithRequiredFields in the example is a shortcut variant to generate a specification that represents the pseudo-code oneOf([<list-of-objects-with-same-base>]).

The real OpenAPI method to implement the above very commonly occurring situation is as presented by the following pseudo-code:

oneOf[allOf[RequiredByBoth, Variant1], allOf[RequiredByBoth, Variant2]]

This is both painful to read and is a lot of extra code to write when you actually expand it all into classes (each oneOf/allOf is another class). Class OneOfKeywordSchema will actually simplify this by automatically making the allOf definitions for you if it detects other schema nodes than oneOf specified in the class bases. You can still do the full oneOf/allOf classes expansion manually though, it will result into the same specification.

Warning

When oneOf/allOf automatic expansion occurs during schema generation

Warning

When calling deserialize(), because the validation process requires exactly one of the variants to succeed to consider the whole object to evaluate as valid, it is important to insert more permissive validators later in the _one_of iterator (or validator keyword). For example, having a variant with all fields defined as optional (ie: with missing=drop) inserted as first item in _one_of will make it always succeed regardless of following variants (since an empty schema with everything dropped is valid for optional-only elements). This would have as side effect of potentially failing the validation if other object are also valid depending on the received schema because the schema cannot be discriminated between many. If this occurs, it means the your schemas are too permissive.

In the event that you have very similar schemas that can sometime match except one identifier (e.g.: field type defining the type of object), consider adding a validator to each sub-node with explicit values to solve the discrimination problem.

As a shortcut, the OpenAPI keyword discriminator can be provided to try matching as a last resort.

For example:

class Animal(ExtendedMappingSchema):
    name = ExtendedSchemaNode(String())
    type = ExtendedSchemaNode(String())  # with explicit definition, this shouldn't be here

    ## With explicit definitions, each below 'Animal' class should be defined as follows
    ## type = ExtendedSchemaNode(String(), validator=colander.OneOf(['<animal>']))

class Cat(Animal):
    [...]   # many **OPTIONAL** fields

class Dog(Animal):
    [...]   # many **OPTIONAL** fields

# With the discriminator keyword, following is possible
class SomeAnimal(OneOfMappingSchema):
    discriminator = {
        "propertyName": "type",     # correspond to 'type' of 'Animal'
        "mapping": {
            "cat": Cat, "dog": Dog  # map expected values to target schemas
        }
    }
    _one_of = [
        Cat(),
        Dog(),
    ]

Note

Keyword discriminator supports a map of key-string to schemas-type as presented in the example, and the key must be located at the top level of the mapping. If only discriminator = "<field>" is provided, the definition will be created automatically using the example (which should be only the matching value) of the corresponding field of each node within the _one_of mapping.

When multiple valid schemas are matched against the input data, the error will be raised and returned with corresponding erroneous elements for each sub-schema (fully listed).

See also

  • AllOfKeywordSchema

  • AnyOfKeywordSchema

  • NotKeywordSchema

class weaver.wps_restapi.swagger_definitions.MetadataList(*args, **kwargs)[source]

Combines DefaultSequenceSchema and DefaultSequenceSchema extensions so that default keyword is used first to resolve a missing sequence during deserialize() call, and then removes the node completely if no default was provided.

See also

  • ExtendedSchemaNode

  • ExtendedMappingSchema

metadata[source]

Combines DefaultSequenceSchema and DefaultSequenceSchema extensions so that default keyword is used first to resolve a missing sequence during deserialize() call, and then removes the node completely if no default was provided.

See also

  • ExtendedSchemaNode

  • ExtendedMappingSchema

description = List of links relative to the applicable object.[source]
title = Links[source]
class weaver.wps_restapi.swagger_definitions.LandingPage(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

class weaver.wps_restapi.swagger_definitions.Format(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

title = Format[source]
mimeType[source]
schema[source]
encoding[source]
class weaver.wps_restapi.swagger_definitions.FormatDefault(*args, **kwargs)[source]

Format for process input are assumed plain text if the MIME-type was omitted and is not one of the known formats by this instance. When executing a job, the best match will be used to run the process, and will fallback to the default as last resort.

mimeType[source]
class weaver.wps_restapi.swagger_definitions.FormatExtra(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

maximumMegabytes[source]
class weaver.wps_restapi.swagger_definitions.FormatDescription(*args, **kwargs)[source]

Format for process input are assumed plain text if the MIME-type was omitted and is not one of the known formats by this instance. When executing a job, the best match will be used to run the process, and will fallback to the default as last resort.

default[source]
class weaver.wps_restapi.swagger_definitions.FormatMedia(*args, **kwargs)[source]

Format employed for reference results respecting ‘OGC-API - Processes’ schemas.

schema_ref[source]
mediaType[source]
schema[source]
encoding[source]
class weaver.wps_restapi.swagger_definitions.FormatDescriptionList(*args, **kwargs)[source]

Combines DefaultSequenceSchema and DefaultSequenceSchema extensions so that default keyword is used first to resolve a missing sequence during deserialize() call, and then removes the node completely if no default was provided.

See also

  • ExtendedSchemaNode

  • ExtendedMappingSchema

format[source]
class weaver.wps_restapi.swagger_definitions.AdditionalParameterValuesList(*args, **kwargs)[source]

Combines DefaultSequenceSchema and DefaultSequenceSchema extensions so that default keyword is used first to resolve a missing sequence during deserialize() call, and then removes the node completely if no default was provided.

See also

  • ExtendedSchemaNode

  • ExtendedMappingSchema

values[source]
class weaver.wps_restapi.swagger_definitions.AdditionalParameter(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

name[source]
values[source]
class weaver.wps_restapi.swagger_definitions.AdditionalParameterList(*args, **kwargs)[source]

Combines DefaultSequenceSchema and DefaultSequenceSchema extensions so that default keyword is used first to resolve a missing sequence during deserialize() call, and then removes the node completely if no default was provided.

See also

  • ExtendedSchemaNode

  • ExtendedMappingSchema

additionalParameter[source]
class weaver.wps_restapi.swagger_definitions.AdditionalParametersMeta(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

class weaver.wps_restapi.swagger_definitions.AdditionalParameters(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

parameters[source]
class weaver.wps_restapi.swagger_definitions.AdditionalParametersItem(*args, **kwargs)[source]

Allows specifying all mapping schemas that can be matched for an underlying schema definition. Corresponds to the anyOf specifier of OpenAPI specification.

Contrary to OneOfKeywordSchema that MUST be validated with exactly one schema, this definition will continue parsing all possibilities and apply validated sub-schemas on top of each other. Not all schemas have to be valid like in the case of AllOfKeywordSchema to succeed, as long as at least one of them is valid.

Example:

class RequiredItem(ExtendedMappingSchema):
    item = ExtendedSchemaNode(String())

class RequiredType(ExtendedMappingSchema):
    type = ExtendedSchemaNode(String())

class RequiredFields(ExtendedMappingSchema):
    field_str = ExtendedSchemaNode(String())
    field_int = ExtendedSchemaNode(Integer())

class AnyRequired(AnyKeywordSchema):
    _any_of = [RequiredItem(), RequiredType(), RequiredFields()]

# following is valid because their individual parts have all required sub-fields, result is their composition
AnyRequired().deserialize({"type": "test", "item": "valid"})     # result: {"type": "test", "item": "valid"}

# following is also valid because even though 'item' is missing, the 'type' is present
AnyRequired().deserialize({"type": "test"})                      # result: {"type": "test"}

# following is invalid because every one of the sub-field of individual parts are missing
AnyRequired().deserialize({"type": "test"})

# following is invalid because fields of 'RequiredFields' are only partially fulfilled
AnyRequired().deserialize({"field_str": "str"})

# following is valid because although fields of 'RequiredFields' are not all fulfilled, 'RequiredType' is valid
AnyRequired().deserialize({"field_str": "str", "type": "str"})  # result: {"type": "test"}

# following is invalid because 'RequiredFields' field 'field_int' is incorrect schema type
AnyRequired().deserialize({"field_str": "str", "field_int": "str"})

# following is valid, but result omits 'type' because its schema-type is incorrect, while others are valid
AnyRequired().deserialize({"field_str": "str", "field_int": 1, "items": "fields", "type": 1})
# result: {"field_str": "str", "field_int": 1, "items": "fields"}

Warning

Because valid items are applied on top of each other by merging fields during combinations, conflicting field names of any valid schema will contain only the final valid parsing during deserialization.

See also

  • OneOfKeywordSchema

  • AllOfKeywordSchema

  • NotKeywordSchema

_any_of[source]
class weaver.wps_restapi.swagger_definitions.AdditionalParametersList(*args, **kwargs)[source]

Combines DefaultSequenceSchema and DefaultSequenceSchema extensions so that default keyword is used first to resolve a missing sequence during deserialize() call, and then removes the node completely if no default was provided.

See also

  • ExtendedSchemaNode

  • ExtendedMappingSchema

additionalParameter[source]
class weaver.wps_restapi.swagger_definitions.Content(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

href[source]
class weaver.wps_restapi.swagger_definitions.Offering(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

code[source]
content[source]
class weaver.wps_restapi.swagger_definitions.OWSContext(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

description = OGC Web Service definition from an URL reference.[source]
title = owsContext[source]
offering[source]
class weaver.wps_restapi.swagger_definitions.DescriptionBase(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

title[source]
abstract[source]
class weaver.wps_restapi.swagger_definitions.DescriptionOWS(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

owsContext[source]
class weaver.wps_restapi.swagger_definitions.DescriptionExtra(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

additionalParameters[source]
class weaver.wps_restapi.swagger_definitions.DescriptionType(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

class weaver.wps_restapi.swagger_definitions.ProcessDescriptionMeta(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

keywords[source]
metadata[source]
class weaver.wps_restapi.swagger_definitions.ProcessDeployMeta(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

keywords[source]
metadata[source]
class weaver.wps_restapi.swagger_definitions.InputOutputDescriptionMeta(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

class weaver.wps_restapi.swagger_definitions.MinOccursDefinition(*args, **kwargs)[source]

Allows specifying multiple supported mapping schemas variants for an underlying schema definition. Corresponds to the oneOf specifier of OpenAPI specification.

Example:

class Variant1(MappingSchema):
    [...fields of Variant1...]

class Variant2(MappingSchema):
    [...fields of Variant2...]

class RequiredByBoth(MappingSchema):
    [...fields required by both Variant1 and Variant2...]

class OneOfWithRequiredFields(OneOfKeywordSchema, RequiredByBoth):
    _one_of = (Variant1, Variant2)
    [...alternatively, field required by all variants here...]

In the above example, the validation (ie: deserialize) process will succeed if only one of the _one_of variants’ validator completely succeed, and will fail if every variant fails validation execution. The operation will also fail if more than one validation succeeds.

Note

Class OneOfWithRequiredFields in the example is a shortcut variant to generate a specification that represents the pseudo-code oneOf([<list-of-objects-with-same-base>]).

The real OpenAPI method to implement the above very commonly occurring situation is as presented by the following pseudo-code:

oneOf[allOf[RequiredByBoth, Variant1], allOf[RequiredByBoth, Variant2]]

This is both painful to read and is a lot of extra code to write when you actually expand it all into classes (each oneOf/allOf is another class). Class OneOfKeywordSchema will actually simplify this by automatically making the allOf definitions for you if it detects other schema nodes than oneOf specified in the class bases. You can still do the full oneOf/allOf classes expansion manually though, it will result into the same specification.

Warning

When oneOf/allOf automatic expansion occurs during schema generation

Warning

When calling deserialize(), because the validation process requires exactly one of the variants to succeed to consider the whole object to evaluate as valid, it is important to insert more permissive validators later in the _one_of iterator (or validator keyword). For example, having a variant with all fields defined as optional (ie: with missing=drop) inserted as first item in _one_of will make it always succeed regardless of following variants (since an empty schema with everything dropped is valid for optional-only elements). This would have as side effect of potentially failing the validation if other object are also valid depending on the received schema because the schema cannot be discriminated between many. If this occurs, it means the your schemas are too permissive.

In the event that you have very similar schemas that can sometime match except one identifier (e.g.: field type defining the type of object), consider adding a validator to each sub-node with explicit values to solve the discrimination problem.

As a shortcut, the OpenAPI keyword discriminator can be provided to try matching as a last resort.

For example:

class Animal(ExtendedMappingSchema):
    name = ExtendedSchemaNode(String())
    type = ExtendedSchemaNode(String())  # with explicit definition, this shouldn't be here

    ## With explicit definitions, each below 'Animal' class should be defined as follows
    ## type = ExtendedSchemaNode(String(), validator=colander.OneOf(['<animal>']))

class Cat(Animal):
    [...]   # many **OPTIONAL** fields

class Dog(Animal):
    [...]   # many **OPTIONAL** fields

# With the discriminator keyword, following is possible
class SomeAnimal(OneOfMappingSchema):
    discriminator = {
        "propertyName": "type",     # correspond to 'type' of 'Animal'
        "mapping": {
            "cat": Cat, "dog": Dog  # map expected values to target schemas
        }
    }
    _one_of = [
        Cat(),
        Dog(),
    ]

Note

Keyword discriminator supports a map of key-string to schemas-type as presented in the example, and the key must be located at the top level of the mapping. If only discriminator = "<field>" is provided, the definition will be created automatically using the example (which should be only the matching value) of the corresponding field of each node within the _one_of mapping.

When multiple valid schemas are matched against the input data, the error will be raised and returned with corresponding erroneous elements for each sub-schema (fully listed).

See also

  • AllOfKeywordSchema

  • AnyOfKeywordSchema

  • NotKeywordSchema

description = Minimum amount of values required for this input.[source]
title = MinOccurs[source]
example = 1[source]
_one_of[source]
class weaver.wps_restapi.swagger_definitions.MaxOccursDefinition(*args, **kwargs)[source]

Allows specifying multiple supported mapping schemas variants for an underlying schema definition. Corresponds to the oneOf specifier of OpenAPI specification.

Example:

class Variant1(MappingSchema):
    [...fields of Variant1...]

class Variant2(MappingSchema):
    [...fields of Variant2...]

class RequiredByBoth(MappingSchema):
    [...fields required by both Variant1 and Variant2...]

class OneOfWithRequiredFields(OneOfKeywordSchema, RequiredByBoth):
    _one_of = (Variant1, Variant2)
    [...alternatively, field required by all variants here...]

In the above example, the validation (ie: deserialize) process will succeed if only one of the _one_of variants’ validator completely succeed, and will fail if every variant fails validation execution. The operation will also fail if more than one validation succeeds.

Note

Class OneOfWithRequiredFields in the example is a shortcut variant to generate a specification that represents the pseudo-code oneOf([<list-of-objects-with-same-base>]).

The real OpenAPI method to implement the above very commonly occurring situation is as presented by the following pseudo-code:

oneOf[allOf[RequiredByBoth, Variant1], allOf[RequiredByBoth, Variant2]]

This is both painful to read and is a lot of extra code to write when you actually expand it all into classes (each oneOf/allOf is another class). Class OneOfKeywordSchema will actually simplify this by automatically making the allOf definitions for you if it detects other schema nodes than oneOf specified in the class bases. You can still do the full oneOf/allOf classes expansion manually though, it will result into the same specification.

Warning

When oneOf/allOf automatic expansion occurs during schema generation

Warning

When calling deserialize(), because the validation process requires exactly one of the variants to succeed to consider the whole object to evaluate as valid, it is important to insert more permissive validators later in the _one_of iterator (or validator keyword). For example, having a variant with all fields defined as optional (ie: with missing=drop) inserted as first item in _one_of will make it always succeed regardless of following variants (since an empty schema with everything dropped is valid for optional-only elements). This would have as side effect of potentially failing the validation if other object are also valid depending on the received schema because the schema cannot be discriminated between many. If this occurs, it means the your schemas are too permissive.

In the event that you have very similar schemas that can sometime match except one identifier (e.g.: field type defining the type of object), consider adding a validator to each sub-node with explicit values to solve the discrimination problem.

As a shortcut, the OpenAPI keyword discriminator can be provided to try matching as a last resort.

For example:

class Animal(ExtendedMappingSchema):
    name = ExtendedSchemaNode(String())
    type = ExtendedSchemaNode(String())  # with explicit definition, this shouldn't be here

    ## With explicit definitions, each below 'Animal' class should be defined as follows
    ## type = ExtendedSchemaNode(String(), validator=colander.OneOf(['<animal>']))

class Cat(Animal):
    [...]   # many **OPTIONAL** fields

class Dog(Animal):
    [...]   # many **OPTIONAL** fields

# With the discriminator keyword, following is possible
class SomeAnimal(OneOfMappingSchema):
    discriminator = {
        "propertyName": "type",     # correspond to 'type' of 'Animal'
        "mapping": {
            "cat": Cat, "dog": Dog  # map expected values to target schemas
        }
    }
    _one_of = [
        Cat(),
        Dog(),
    ]

Note

Keyword discriminator supports a map of key-string to schemas-type as presented in the example, and the key must be located at the top level of the mapping. If only discriminator = "<field>" is provided, the definition will be created automatically using the example (which should be only the matching value) of the corresponding field of each node within the _one_of mapping.

When multiple valid schemas are matched against the input data, the error will be raised and returned with corresponding erroneous elements for each sub-schema (fully listed).

See also

  • AllOfKeywordSchema

  • AnyOfKeywordSchema

  • NotKeywordSchema

description = Maximum amount of values allowed for this input.[source]
title = MaxOccurs[source]
example = 1[source]
_one_of[source]
class weaver.wps_restapi.swagger_definitions.WithMinMaxOccurs(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

minOccurs[source]
maxOccurs[source]
class weaver.wps_restapi.swagger_definitions.ProcessDescriptionType(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

id[source]
class weaver.wps_restapi.swagger_definitions.InputIdentifierType(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

id[source]
class weaver.wps_restapi.swagger_definitions.OutputIdentifierType(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

id[source]
class weaver.wps_restapi.swagger_definitions.InputDescriptionType(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

class weaver.wps_restapi.swagger_definitions.OutputDescriptionType(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

class weaver.wps_restapi.swagger_definitions.WithFormats(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

formats[source]
class weaver.wps_restapi.swagger_definitions.ComplexInputType(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

class weaver.wps_restapi.swagger_definitions.SupportedCRS(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

crs[source]
default[source]
class weaver.wps_restapi.swagger_definitions.SupportedCRSList(*args, **kwargs)[source]

Combines DefaultSequenceSchema and DefaultSequenceSchema extensions so that default keyword is used first to resolve a missing sequence during deserialize() call, and then removes the node completely if no default was provided.

See also

  • ExtendedSchemaNode

  • ExtendedMappingSchema

crs[source]
class weaver.wps_restapi.swagger_definitions.BoundingBoxInputType(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

supportedCRS[source]
class weaver.wps_restapi.swagger_definitions.LiteralReference(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

reference[source]
class weaver.wps_restapi.swagger_definitions.NameReferenceType(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

schema_ref[source]
name[source]
reference[source]
class weaver.wps_restapi.swagger_definitions.DataTypeSchema(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

description = Type of the literal data representation.[source]
title = DataType[source]
class weaver.wps_restapi.swagger_definitions.UomSchema(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

title = UnitOfMeasure[source]
class weaver.wps_restapi.swagger_definitions.AllowedValuesList(*args, **kwargs)[source]

Combines DefaultSequenceSchema and DefaultSequenceSchema extensions so that default keyword is used first to resolve a missing sequence during deserialize() call, and then removes the node completely if no default was provided.

See also

  • ExtendedSchemaNode

  • ExtendedMappingSchema

allowedValues[source]
class weaver.wps_restapi.swagger_definitions.AllowedValues(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

allowedValues[source]
class weaver.wps_restapi.swagger_definitions.AllowedRange(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

minimumValue[source]
maximumValue[source]
spacing[source]
rangeClosure[source]
class weaver.wps_restapi.swagger_definitions.AllowedRangesList(*args, **kwargs)[source]

Combines DefaultSequenceSchema and DefaultSequenceSchema extensions so that default keyword is used first to resolve a missing sequence during deserialize() call, and then removes the node completely if no default was provided.

See also

  • ExtendedSchemaNode

  • ExtendedMappingSchema

allowedRanges[source]
class weaver.wps_restapi.swagger_definitions.AllowedRanges(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

allowedRanges[source]
class weaver.wps_restapi.swagger_definitions.AnyValue(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

anyValue[source]
class weaver.wps_restapi.swagger_definitions.ValuesReference(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

valueReference[source]
class weaver.wps_restapi.swagger_definitions.AnyLiteralType(*args, **kwargs)[source]
_one_of[source]
class weaver.wps_restapi.swagger_definitions.AnyLiteralDataType(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

data[source]
class weaver.wps_restapi.swagger_definitions.AnyLiteralValueType(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

value[source]
class weaver.wps_restapi.swagger_definitions.AnyLiteralDefaultType(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

default[source]
class weaver.wps_restapi.swagger_definitions.LiteralDataDomainDefinition(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

default[source]
defaultValue[source]
dataType[source]
uom[source]
class weaver.wps_restapi.swagger_definitions.LiteralDataDomainConstraints(*args, **kwargs)[source]

Allows specifying multiple supported mapping schemas variants for an underlying schema definition. Corresponds to the oneOf specifier of OpenAPI specification.

Example:

class Variant1(MappingSchema):
    [...fields of Variant1...]

class Variant2(MappingSchema):
    [...fields of Variant2...]

class RequiredByBoth(MappingSchema):
    [...fields required by both Variant1 and Variant2...]

class OneOfWithRequiredFields(OneOfKeywordSchema, RequiredByBoth):
    _one_of = (Variant1, Variant2)
    [...alternatively, field required by all variants here...]

In the above example, the validation (ie: deserialize) process will succeed if only one of the _one_of variants’ validator completely succeed, and will fail if every variant fails validation execution. The operation will also fail if more than one validation succeeds.

Note

Class OneOfWithRequiredFields in the example is a shortcut variant to generate a specification that represents the pseudo-code oneOf([<list-of-objects-with-same-base>]).

The real OpenAPI method to implement the above very commonly occurring situation is as presented by the following pseudo-code:

oneOf[allOf[RequiredByBoth, Variant1], allOf[RequiredByBoth, Variant2]]

This is both painful to read and is a lot of extra code to write when you actually expand it all into classes (each oneOf/allOf is another class). Class OneOfKeywordSchema will actually simplify this by automatically making the allOf definitions for you if it detects other schema nodes than oneOf specified in the class bases. You can still do the full oneOf/allOf classes expansion manually though, it will result into the same specification.

Warning

When oneOf/allOf automatic expansion occurs during schema generation

Warning

When calling deserialize(), because the validation process requires exactly one of the variants to succeed to consider the whole object to evaluate as valid, it is important to insert more permissive validators later in the _one_of iterator (or validator keyword). For example, having a variant with all fields defined as optional (ie: with missing=drop) inserted as first item in _one_of will make it always succeed regardless of following variants (since an empty schema with everything dropped is valid for optional-only elements). This would have as side effect of potentially failing the validation if other object are also valid depending on the received schema because the schema cannot be discriminated between many. If this occurs, it means the your schemas are too permissive.

In the event that you have very similar schemas that can sometime match except one identifier (e.g.: field type defining the type of object), consider adding a validator to each sub-node with explicit values to solve the discrimination problem.

As a shortcut, the OpenAPI keyword discriminator can be provided to try matching as a last resort.

For example:

class Animal(ExtendedMappingSchema):
    name = ExtendedSchemaNode(String())
    type = ExtendedSchemaNode(String())  # with explicit definition, this shouldn't be here

    ## With explicit definitions, each below 'Animal' class should be defined as follows
    ## type = ExtendedSchemaNode(String(), validator=colander.OneOf(['<animal>']))

class Cat(Animal):
    [...]   # many **OPTIONAL** fields

class Dog(Animal):
    [...]   # many **OPTIONAL** fields

# With the discriminator keyword, following is possible
class SomeAnimal(OneOfMappingSchema):
    discriminator = {
        "propertyName": "type",     # correspond to 'type' of 'Animal'
        "mapping": {
            "cat": Cat, "dog": Dog  # map expected values to target schemas
        }
    }
    _one_of = [
        Cat(),
        Dog(),
    ]

Note

Keyword discriminator supports a map of key-string to schemas-type as presented in the example, and the key must be located at the top level of the mapping. If only discriminator = "<field>" is provided, the definition will be created automatically using the example (which should be only the matching value) of the corresponding field of each node within the _one_of mapping.

When multiple valid schemas are matched against the input data, the error will be raised and returned with corresponding erroneous elements for each sub-schema (fully listed).

See also

  • AllOfKeywordSchema

  • AnyOfKeywordSchema

  • NotKeywordSchema

_one_of[source]
class weaver.wps_restapi.swagger_definitions.LiteralDataDomainList(*args, **kwargs)[source]

Combines DefaultSequenceSchema and DefaultSequenceSchema extensions so that default keyword is used first to resolve a missing sequence during deserialize() call, and then removes the node completely if no default was provided.

See also

  • ExtendedSchemaNode

  • ExtendedMappingSchema

literalDataDomain[source]
class weaver.wps_restapi.swagger_definitions.LiteralInputType(*args, **kwargs)[source]

Allows specifying specific schema conditions that fails underlying schema definition validation if present.

Corresponds to the not specifier of OpenAPI specification.

This is equivalent to OpenAPI object mapping with additionalProperties: false, but is more explicit in the definition of invalid or conflicting field names with explicit definitions during deserialization.

Example:

class RequiredItem(ExtendedMappingSchema):
    item = ExtendedSchemaNode(String())

class MappingWithType(ExtendedMappingSchema):
    type = ExtendedSchemaNode(String())

class MappingWithoutType(NotKeywordSchema, RequiredItem):
    _not = [MappingWithType()]

class MappingOnlyNotType(NotKeywordSchema):
    _not = [MappingWithType()]

# following will raise invalid error even if 'item' is valid because 'type' is also present
MappingWithoutType().deserialize({"type": "invalid", "item": "valid"})

# following will return successfully with only 'item' because 'type' was not present
MappingWithoutType().deserialize({"item": "valid", "value": "ignore"})
# result: {"item": "valid"}

# following will return an empty mapping dropping 'item' since it only needs to ensure 'type' was not present,
# but did not provide any additional fields requirement from other class inheritances
MappingOnlyNotType().deserialize({"item": "valid"})
# result: {}

See also

  • OneOfKeywordSchema

  • AllOfKeywordSchema

  • AnyOfKeywordSchema

_not[source]
literalDataDomains[source]
class weaver.wps_restapi.swagger_definitions.InputTypeDefinition(*args, **kwargs)[source]

Allows specifying multiple supported mapping schemas variants for an underlying schema definition. Corresponds to the oneOf specifier of OpenAPI specification.

Example:

class Variant1(MappingSchema):
    [...fields of Variant1...]

class Variant2(MappingSchema):
    [...fields of Variant2...]

class RequiredByBoth(MappingSchema):
    [...fields required by both Variant1 and Variant2...]

class OneOfWithRequiredFields(OneOfKeywordSchema, RequiredByBoth):
    _one_of = (Variant1, Variant2)
    [...alternatively, field required by all variants here...]

In the above example, the validation (ie: deserialize) process will succeed if only one of the _one_of variants’ validator completely succeed, and will fail if every variant fails validation execution. The operation will also fail if more than one validation succeeds.

Note

Class OneOfWithRequiredFields in the example is a shortcut variant to generate a specification that represents the pseudo-code oneOf([<list-of-objects-with-same-base>]).

The real OpenAPI method to implement the above very commonly occurring situation is as presented by the following pseudo-code:

oneOf[allOf[RequiredByBoth, Variant1], allOf[RequiredByBoth, Variant2]]

This is both painful to read and is a lot of extra code to write when you actually expand it all into classes (each oneOf/allOf is another class). Class OneOfKeywordSchema will actually simplify this by automatically making the allOf definitions for you if it detects other schema nodes than oneOf specified in the class bases. You can still do the full oneOf/allOf classes expansion manually though, it will result into the same specification.

Warning

When oneOf/allOf automatic expansion occurs during schema generation

Warning

When calling deserialize(), because the validation process requires exactly one of the variants to succeed to consider the whole object to evaluate as valid, it is important to insert more permissive validators later in the _one_of iterator (or validator keyword). For example, having a variant with all fields defined as optional (ie: with missing=drop) inserted as first item in _one_of will make it always succeed regardless of following variants (since an empty schema with everything dropped is valid for optional-only elements). This would have as side effect of potentially failing the validation if other object are also valid depending on the received schema because the schema cannot be discriminated between many. If this occurs, it means the your schemas are too permissive.

In the event that you have very similar schemas that can sometime match except one identifier (e.g.: field type defining the type of object), consider adding a validator to each sub-node with explicit values to solve the discrimination problem.

As a shortcut, the OpenAPI keyword discriminator can be provided to try matching as a last resort.

For example:

class Animal(ExtendedMappingSchema):
    name = ExtendedSchemaNode(String())
    type = ExtendedSchemaNode(String())  # with explicit definition, this shouldn't be here

    ## With explicit definitions, each below 'Animal' class should be defined as follows
    ## type = ExtendedSchemaNode(String(), validator=colander.OneOf(['<animal>']))

class Cat(Animal):
    [...]   # many **OPTIONAL** fields

class Dog(Animal):
    [...]   # many **OPTIONAL** fields

# With the discriminator keyword, following is possible
class SomeAnimal(OneOfMappingSchema):
    discriminator = {
        "propertyName": "type",     # correspond to 'type' of 'Animal'
        "mapping": {
            "cat": Cat, "dog": Dog  # map expected values to target schemas
        }
    }
    _one_of = [
        Cat(),
        Dog(),
    ]

Note

Keyword discriminator supports a map of key-string to schemas-type as presented in the example, and the key must be located at the top level of the mapping. If only discriminator = "<field>" is provided, the definition will be created automatically using the example (which should be only the matching value) of the corresponding field of each node within the _one_of mapping.

When multiple valid schemas are matched against the input data, the error will be raised and returned with corresponding erroneous elements for each sub-schema (fully listed).

See also

  • AllOfKeywordSchema

  • AnyOfKeywordSchema

  • NotKeywordSchema

_one_of[source]
class weaver.wps_restapi.swagger_definitions.InputType(*args, **kwargs)[source]

Allows specifying all the required partial mapping schemas for an underlying complete schema definition. Corresponds to the allOf specifier of OpenAPI specification.

Example:

class RequiredItem(ExtendedMappingSchema):
    item = ExtendedSchemaNode(String())

class RequiredType(ExtendedMappingSchema):
    type = ExtendedSchemaNode(String())

class AllRequired(AnyKeywordSchema):
    _all_of = [RequiredItem(), RequiredType()]

Value parsed with schema this definition will be valid only when every since one of the sub-schemas is valid. Any sub-schema raising an invalid error for any reason with make the whole schema validation fail.

See also

  • OneOfKeywordSchema

  • AnyOfKeywordSchema

  • NotKeywordSchema

_all_of[source]
class weaver.wps_restapi.swagger_definitions.InputTypeList(*args, **kwargs)[source]

Combines DefaultSequenceSchema and DefaultSequenceSchema extensions so that default keyword is used first to resolve a missing sequence during deserialize() call, and then removes the node completely if no default was provided.

See also

  • ExtendedSchemaNode

  • ExtendedMappingSchema

input[source]
class weaver.wps_restapi.swagger_definitions.LiteralOutputType(*args, **kwargs)[source]

Allows specifying specific schema conditions that fails underlying schema definition validation if present.

Corresponds to the not specifier of OpenAPI specification.

This is equivalent to OpenAPI object mapping with additionalProperties: false, but is more explicit in the definition of invalid or conflicting field names with explicit definitions during deserialization.

Example:

class RequiredItem(ExtendedMappingSchema):
    item = ExtendedSchemaNode(String())

class MappingWithType(ExtendedMappingSchema):
    type = ExtendedSchemaNode(String())

class MappingWithoutType(NotKeywordSchema, RequiredItem):
    _not = [MappingWithType()]

class MappingOnlyNotType(NotKeywordSchema):
    _not = [MappingWithType()]

# following will raise invalid error even if 'item' is valid because 'type' is also present
MappingWithoutType().deserialize({"type": "invalid", "item": "valid"})

# following will return successfully with only 'item' because 'type' was not present
MappingWithoutType().deserialize({"item": "valid", "value": "ignore"})
# result: {"item": "valid"}

# following will return an empty mapping dropping 'item' since it only needs to ensure 'type' was not present,
# but did not provide any additional fields requirement from other class inheritances
MappingOnlyNotType().deserialize({"item": "valid"})
# result: {}

See also

  • OneOfKeywordSchema

  • AllOfKeywordSchema

  • AnyOfKeywordSchema

_not[source]
literalDataDomains[source]
class weaver.wps_restapi.swagger_definitions.BoundingBoxOutputType(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

supportedCRS[source]
class weaver.wps_restapi.swagger_definitions.ComplexOutputType(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

class weaver.wps_restapi.swagger_definitions.OutputTypeDefinition(*args, **kwargs)[source]

Allows specifying multiple supported mapping schemas variants for an underlying schema definition. Corresponds to the oneOf specifier of OpenAPI specification.

Example:

class Variant1(MappingSchema):
    [...fields of Variant1...]

class Variant2(MappingSchema):
    [...fields of Variant2...]

class RequiredByBoth(MappingSchema):
    [...fields required by both Variant1 and Variant2...]

class OneOfWithRequiredFields(OneOfKeywordSchema, RequiredByBoth):
    _one_of = (Variant1, Variant2)
    [...alternatively, field required by all variants here...]

In the above example, the validation (ie: deserialize) process will succeed if only one of the _one_of variants’ validator completely succeed, and will fail if every variant fails validation execution. The operation will also fail if more than one validation succeeds.

Note

Class OneOfWithRequiredFields in the example is a shortcut variant to generate a specification that represents the pseudo-code oneOf([<list-of-objects-with-same-base>]).

The real OpenAPI method to implement the above very commonly occurring situation is as presented by the following pseudo-code:

oneOf[allOf[RequiredByBoth, Variant1], allOf[RequiredByBoth, Variant2]]

This is both painful to read and is a lot of extra code to write when you actually expand it all into classes (each oneOf/allOf is another class). Class OneOfKeywordSchema will actually simplify this by automatically making the allOf definitions for you if it detects other schema nodes than oneOf specified in the class bases. You can still do the full oneOf/allOf classes expansion manually though, it will result into the same specification.

Warning

When oneOf/allOf automatic expansion occurs during schema generation

Warning

When calling deserialize(), because the validation process requires exactly one of the variants to succeed to consider the whole object to evaluate as valid, it is important to insert more permissive validators later in the _one_of iterator (or validator keyword). For example, having a variant with all fields defined as optional (ie: with missing=drop) inserted as first item in _one_of will make it always succeed regardless of following variants (since an empty schema with everything dropped is valid for optional-only elements). This would have as side effect of potentially failing the validation if other object are also valid depending on the received schema because the schema cannot be discriminated between many. If this occurs, it means the your schemas are too permissive.

In the event that you have very similar schemas that can sometime match except one identifier (e.g.: field type defining the type of object), consider adding a validator to each sub-node with explicit values to solve the discrimination problem.

As a shortcut, the OpenAPI keyword discriminator can be provided to try matching as a last resort.

For example:

class Animal(ExtendedMappingSchema):
    name = ExtendedSchemaNode(String())
    type = ExtendedSchemaNode(String())  # with explicit definition, this shouldn't be here

    ## With explicit definitions, each below 'Animal' class should be defined as follows
    ## type = ExtendedSchemaNode(String(), validator=colander.OneOf(['<animal>']))

class Cat(Animal):
    [...]   # many **OPTIONAL** fields

class Dog(Animal):
    [...]   # many **OPTIONAL** fields

# With the discriminator keyword, following is possible
class SomeAnimal(OneOfMappingSchema):
    discriminator = {
        "propertyName": "type",     # correspond to 'type' of 'Animal'
        "mapping": {
            "cat": Cat, "dog": Dog  # map expected values to target schemas
        }
    }
    _one_of = [
        Cat(),
        Dog(),
    ]

Note

Keyword discriminator supports a map of key-string to schemas-type as presented in the example, and the key must be located at the top level of the mapping. If only discriminator = "<field>" is provided, the definition will be created automatically using the example (which should be only the matching value) of the corresponding field of each node within the _one_of mapping.

When multiple valid schemas are matched against the input data, the error will be raised and returned with corresponding erroneous elements for each sub-schema (fully listed).

See also

  • AllOfKeywordSchema

  • AnyOfKeywordSchema

  • NotKeywordSchema

_one_of[source]
class weaver.wps_restapi.swagger_definitions.OutputType(*args, **kwargs)[source]

Allows specifying all the required partial mapping schemas for an underlying complete schema definition. Corresponds to the allOf specifier of OpenAPI specification.

Example:

class RequiredItem(ExtendedMappingSchema):
    item = ExtendedSchemaNode(String())

class RequiredType(ExtendedMappingSchema):
    type = ExtendedSchemaNode(String())

class AllRequired(AnyKeywordSchema):
    _all_of = [RequiredItem(), RequiredType()]

Value parsed with schema this definition will be valid only when every since one of the sub-schemas is valid. Any sub-schema raising an invalid error for any reason with make the whole schema validation fail.

See also

  • OneOfKeywordSchema

  • AnyOfKeywordSchema

  • NotKeywordSchema

_all_of[source]
class weaver.wps_restapi.swagger_definitions.OutputDescriptionList(*args, **kwargs)[source]

Combines DefaultSequenceSchema and DefaultSequenceSchema extensions so that default keyword is used first to resolve a missing sequence during deserialize() call, and then removes the node completely if no default was provided.

See also

  • ExtendedSchemaNode

  • ExtendedMappingSchema

output[source]
class weaver.wps_restapi.swagger_definitions.JobExecuteModeEnum(*args, **kwargs)[source]

Combines all colander.SchemaNode extensions so that default keyword is used first to resolve a missing field value during deserialize() call, and then removes the node completely if no default was provided, and evaluate variables as needed.

See also

  • ExtendedMappingSchema

  • ExtendedSequenceSchema

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

schema_type[source]
title = JobExecuteMode[source]
example[source]
validator[source]
class weaver.wps_restapi.swagger_definitions.JobControlOptionsEnum(*args, **kwargs)[source]

Combines all colander.SchemaNode extensions so that default keyword is used first to resolve a missing field value during deserialize() call, and then removes the node completely if no default was provided, and evaluate variables as needed.

See also

  • ExtendedMappingSchema

  • ExtendedSequenceSchema

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

schema_type[source]
title = JobControlOptions[source]
default[source]
example[source]
validator[source]
class weaver.wps_restapi.swagger_definitions.JobResponseOptionsEnum(*args, **kwargs)[source]

Combines all colander.SchemaNode extensions so that default keyword is used first to resolve a missing field value during deserialize() call, and then removes the node completely if no default was provided, and evaluate variables as needed.

See also

  • ExtendedMappingSchema

  • ExtendedSequenceSchema

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

schema_type[source]
title = JobResponseOptions[source]
example[source]
validator[source]
class weaver.wps_restapi.swagger_definitions.TransmissionModeEnum(*args, **kwargs)[source]

Combines all colander.SchemaNode extensions so that default keyword is used first to resolve a missing field value during deserialize() call, and then removes the node completely if no default was provided, and evaluate variables as needed.

See also

  • ExtendedMappingSchema

  • ExtendedSequenceSchema

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

schema_type[source]
title = TransmissionMode[source]
default[source]
example[source]
validator[source]
class weaver.wps_restapi.swagger_definitions.JobStatusEnum(*args, **kwargs)[source]

Combines all colander.SchemaNode extensions so that default keyword is used first to resolve a missing field value during deserialize() call, and then removes the node completely if no default was provided, and evaluate variables as needed.

See also

  • ExtendedMappingSchema

  • ExtendedSequenceSchema

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

schema_type[source]
title = JobStatus[source]
default[source]
example[source]
validator[source]
class weaver.wps_restapi.swagger_definitions.JobSortEnum(*args, **kwargs)[source]

Combines all colander.SchemaNode extensions so that default keyword is used first to resolve a missing field value during deserialize() call, and then removes the node completely if no default was provided, and evaluate variables as needed.

See also

  • ExtendedMappingSchema

  • ExtendedSequenceSchema

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

schema_type[source]
title = JobSortingMethod[source]
default[source]
example[source]
validator[source]
class weaver.wps_restapi.swagger_definitions.QuoteSortEnum(*args, **kwargs)[source]

Combines all colander.SchemaNode extensions so that default keyword is used first to resolve a missing field value during deserialize() call, and then removes the node completely if no default was provided, and evaluate variables as needed.

See also

  • ExtendedMappingSchema

  • ExtendedSequenceSchema

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

schema_type[source]
title = QuoteSortingMethod[source]
default[source]
example[source]
validator[source]
class weaver.wps_restapi.swagger_definitions.LaunchJobQuerystring(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

tags[source]
class weaver.wps_restapi.swagger_definitions.VisibilityValue(*args, **kwargs)[source]

Combines all colander.SchemaNode extensions so that default keyword is used first to resolve a missing field value during deserialize() call, and then removes the node completely if no default was provided, and evaluate variables as needed.

See also

  • ExtendedMappingSchema

  • ExtendedSequenceSchema

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

schema_type[source]
validator[source]
example[source]
class weaver.wps_restapi.swagger_definitions.JobAccess(*args, **kwargs)[source]

Combines all colander.SchemaNode extensions so that default keyword is used first to resolve a missing field value during deserialize() call, and then removes the node completely if no default was provided, and evaluate variables as needed.

See also

  • ExtendedMappingSchema

  • ExtendedSequenceSchema

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

class weaver.wps_restapi.swagger_definitions.Visibility(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

value[source]
class weaver.wps_restapi.swagger_definitions.ProcessPath(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

process_id[source]
class weaver.wps_restapi.swagger_definitions.ProviderPath(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

provider_id[source]
class weaver.wps_restapi.swagger_definitions.JobPath(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

job_id[source]
class weaver.wps_restapi.swagger_definitions.BillPath(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

bill_id[source]
class weaver.wps_restapi.swagger_definitions.QuotePath(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

quote_id[source]
class weaver.wps_restapi.swagger_definitions.ResultPath(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

result_id[source]
class weaver.wps_restapi.swagger_definitions.FrontpageEndpoint(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

header[source]
class weaver.wps_restapi.swagger_definitions.VersionsEndpoint(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

header[source]
class weaver.wps_restapi.swagger_definitions.ConformanceEndpoint(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

header[source]
class weaver.wps_restapi.swagger_definitions.OpenAPIEndpoint(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

header[source]
class weaver.wps_restapi.swagger_definitions.SwaggerUIEndpoint(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

class weaver.wps_restapi.swagger_definitions.RedocUIEndpoint(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

class weaver.wps_restapi.swagger_definitions.OWSNamespace[source]

Object that provides mapping to known XML extensions for OpenAPI schema definition.

Name of the schema definition in the OpenAPI will use :prop:`prefix` and the schema class name. Prefix can be omitted from the schema definition name by setting it to colander.drop. The value of title provided as option or

prefix = ows[source]
namespace = http://www.opengis.net/ows/1.1[source]
class weaver.wps_restapi.swagger_definitions.WPSNamespace[source]

Object that provides mapping to known XML extensions for OpenAPI schema definition.

Name of the schema definition in the OpenAPI will use :prop:`prefix` and the schema class name. Prefix can be omitted from the schema definition name by setting it to colander.drop. The value of title provided as option or

prefix = wps[source]
namespace = http://www.opengis.net/wps/1.0.0[source]
class weaver.wps_restapi.swagger_definitions.XMLNamespace[source]

Object that provides mapping to known XML extensions for OpenAPI schema definition.

Name of the schema definition in the OpenAPI will use :prop:`prefix` and the schema class name. Prefix can be omitted from the schema definition name by setting it to colander.drop. The value of title provided as option or

prefix = xml[source]
class weaver.wps_restapi.swagger_definitions.XMLReferenceAttribute(*args, **kwargs)[source]

Combines all colander.SchemaNode extensions so that default keyword is used first to resolve a missing field value during deserialize() call, and then removes the node completely if no default was provided, and evaluate variables as needed.

See also

  • ExtendedMappingSchema

  • ExtendedSequenceSchema

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

schema_type[source]
attribute = True[source]
name = href[source]
prefix = xlink[source]
format = url[source]
class weaver.wps_restapi.swagger_definitions.MimeTypeAttribute(*args, **kwargs)[source]

Combines all colander.SchemaNode extensions so that default keyword is used first to resolve a missing field value during deserialize() call, and then removes the node completely if no default was provided, and evaluate variables as needed.

See also

  • ExtendedMappingSchema

  • ExtendedSequenceSchema

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

schema_type[source]
attribute = True[source]
name = mimeType[source]
prefix[source]
example[source]
class weaver.wps_restapi.swagger_definitions.EncodingAttribute(*args, **kwargs)[source]

Combines all colander.SchemaNode extensions so that default keyword is used first to resolve a missing field value during deserialize() call, and then removes the node completely if no default was provided, and evaluate variables as needed.

See also

  • ExtendedMappingSchema

  • ExtendedSequenceSchema

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

schema_type[source]
attribute = True[source]
name = encoding[source]
prefix[source]
example = UTF-8[source]
class weaver.wps_restapi.swagger_definitions.OWSVersion(*args, **kwargs)[source]

Combines all colander.SchemaNode extensions so that default keyword is used first to resolve a missing field value during deserialize() call, and then removes the node completely if no default was provided, and evaluate variables as needed.

See also

  • ExtendedMappingSchema

  • ExtendedSequenceSchema

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

schema_type[source]
name = Version[source]
default = 1.0.0[source]
example = 1.0.0[source]
class weaver.wps_restapi.swagger_definitions.OWSAcceptVersions(*args, **kwargs)[source]

Combines DefaultSequenceSchema and DefaultSequenceSchema extensions so that default keyword is used first to resolve a missing sequence during deserialize() call, and then removes the node completely if no default was provided.

See also

  • ExtendedSchemaNode

  • ExtendedMappingSchema

description = Accepted versions to produce the response.[source]
name = AcceptVersions[source]
item[source]
class weaver.wps_restapi.swagger_definitions.OWSLanguage(*args, **kwargs)[source]

Combines all colander.SchemaNode extensions so that default keyword is used first to resolve a missing field value during deserialize() call, and then removes the node completely if no default was provided, and evaluate variables as needed.

See also

  • ExtendedMappingSchema

  • ExtendedSequenceSchema

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

description = Desired language to produce the response.[source]
schema_type[source]
name = Language[source]
default[source]
example[source]
class weaver.wps_restapi.swagger_definitions.OWSLanguageAttribute(*args, **kwargs)[source]

Combines all colander.SchemaNode extensions so that default keyword is used first to resolve a missing field value during deserialize() call, and then removes the node completely if no default was provided, and evaluate variables as needed.

See also

  • ExtendedMappingSchema

  • ExtendedSequenceSchema

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

description = RFC-4646 language code of the human-readable text.[source]
name = language[source]
attribute = True[source]
class weaver.wps_restapi.swagger_definitions.OWSService(*args, **kwargs)[source]

Combines all colander.SchemaNode extensions so that default keyword is used first to resolve a missing field value during deserialize() call, and then removes the node completely if no default was provided, and evaluate variables as needed.

See also

  • ExtendedMappingSchema

  • ExtendedSequenceSchema

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

description = Desired service to produce the response (SHOULD be 'WPS').[source]
schema_type[source]
name = service[source]
attribute = True[source]
default[source]
example[source]
class weaver.wps_restapi.swagger_definitions.WPSServiceAttribute(*args, **kwargs)[source]

Combines all colander.SchemaNode extensions so that default keyword is used first to resolve a missing field value during deserialize() call, and then removes the node completely if no default was provided, and evaluate variables as needed.

See also

  • ExtendedMappingSchema

  • ExtendedSequenceSchema

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

schema_type[source]
name = service[source]
attribute = True[source]
default = WPS[source]
example = WPS[source]
class weaver.wps_restapi.swagger_definitions.WPSVersionAttribute(*args, **kwargs)[source]

Combines all colander.SchemaNode extensions so that default keyword is used first to resolve a missing field value during deserialize() call, and then removes the node completely if no default was provided, and evaluate variables as needed.

See also

  • ExtendedMappingSchema

  • ExtendedSequenceSchema

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

schema_type[source]
name = version[source]
attribute = True[source]
default = 1.0.0[source]
example = 1.0.0[source]
class weaver.wps_restapi.swagger_definitions.WPSLanguageAttribute(*args, **kwargs)[source]

Combines all colander.SchemaNode extensions so that default keyword is used first to resolve a missing field value during deserialize() call, and then removes the node completely if no default was provided, and evaluate variables as needed.

See also

  • ExtendedMappingSchema

  • ExtendedSequenceSchema

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

schema_type[source]
name = lang[source]
attribute = True[source]
default[source]
example[source]
class weaver.wps_restapi.swagger_definitions.WPSParameters(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

service[source]
request[source]
version[source]
identifier[source]
data_inputs[source]
class weaver.wps_restapi.swagger_definitions.WPSOperationGetNoContent(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

description = No content body provided (GET requests).[source]
default[source]
class weaver.wps_restapi.swagger_definitions.WPSOperationPost(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

schema_ref = http://schemas.opengis.net/wps/1.0.0/common/RequestBaseType.xsd[source]
accepted_versions[source]
language[source]
service[source]
class weaver.wps_restapi.swagger_definitions.WPSGetCapabilitiesPost(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

schema_ref = http://schemas.opengis.net/wps/1.0.0/wpsGetCapabilities_request.xsd[source]
name = GetCapabilities[source]
title = GetCapabilities[source]
class weaver.wps_restapi.swagger_definitions.OWSIdentifier(*args, **kwargs)[source]

Combines all colander.SchemaNode extensions so that default keyword is used first to resolve a missing field value during deserialize() call, and then removes the node completely if no default was provided, and evaluate variables as needed.

See also

  • ExtendedMappingSchema

  • ExtendedSequenceSchema

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

schema_type[source]
name = Identifier[source]
class weaver.wps_restapi.swagger_definitions.OWSIdentifierList(*args, **kwargs)[source]

Combines DefaultSequenceSchema and DefaultSequenceSchema extensions so that default keyword is used first to resolve a missing sequence during deserialize() call, and then removes the node completely if no default was provided.

See also

  • ExtendedSchemaNode

  • ExtendedMappingSchema

name = Identifiers[source]
item[source]
class weaver.wps_restapi.swagger_definitions.OWSTitle(*args, **kwargs)[source]

Combines all colander.SchemaNode extensions so that default keyword is used first to resolve a missing field value during deserialize() call, and then removes the node completely if no default was provided, and evaluate variables as needed.

See also

  • ExtendedMappingSchema

  • ExtendedSequenceSchema

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

schema_type[source]
name = Title[source]
class weaver.wps_restapi.swagger_definitions.OWSAbstract(*args, **kwargs)[source]

Combines all colander.SchemaNode extensions so that default keyword is used first to resolve a missing field value during deserialize() call, and then removes the node completely if no default was provided, and evaluate variables as needed.

See also

  • ExtendedMappingSchema

  • ExtendedSequenceSchema

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

schema_type[source]
name = Abstract[source]

Combines all colander.SchemaNode extensions so that default keyword is used first to resolve a missing field value during deserialize() call, and then removes the node completely if no default was provided, and evaluate variables as needed.

See also

  • ExtendedMappingSchema

  • ExtendedSequenceSchema

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

schema_name = Metadata[source]
schema_type[source]
attribute = True[source]
name = Metadata[source]
prefix = xlink[source]
example = WPS[source]
wrapped = False[source]
class weaver.wps_restapi.swagger_definitions.OWSMetadata(*args, **kwargs)[source]

Combines DefaultSequenceSchema and DefaultSequenceSchema extensions so that default keyword is used first to resolve a missing sequence during deserialize() call, and then removes the node completely if no default was provided.

See also

  • ExtendedSchemaNode

  • ExtendedMappingSchema

schema_type[source]
name = Metadata[source]
title[source]
class weaver.wps_restapi.swagger_definitions.WPSDescribeProcessPost(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

schema_ref = http://schemas.opengis.net/wps/1.0.0/wpsDescribeProcess_request.xsd[source]
name = DescribeProcess[source]
title = DescribeProcess[source]
identifier[source]
class weaver.wps_restapi.swagger_definitions.WPSExecuteDataInputs(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

description = XML data inputs provided for WPS POST request (Execute).[source]
name = DataInputs[source]
title = DataInputs[source]
class weaver.wps_restapi.swagger_definitions.WPSExecutePost(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

schema_ref = http://schemas.opengis.net/wps/1.0.0/wpsExecute_request.xsd[source]
name = Execute[source]
title = Execute[source]
identifier[source]
dataInputs[source]
class weaver.wps_restapi.swagger_definitions.WPSRequestBody(*args, **kwargs)[source]

Allows specifying multiple supported mapping schemas variants for an underlying schema definition. Corresponds to the oneOf specifier of OpenAPI specification.

Example:

class Variant1(MappingSchema):
    [...fields of Variant1...]

class Variant2(MappingSchema):
    [...fields of Variant2...]

class RequiredByBoth(MappingSchema):
    [...fields required by both Variant1 and Variant2...]

class OneOfWithRequiredFields(OneOfKeywordSchema, RequiredByBoth):
    _one_of = (Variant1, Variant2)
    [...alternatively, field required by all variants here...]

In the above example, the validation (ie: deserialize) process will succeed if only one of the _one_of variants’ validator completely succeed, and will fail if every variant fails validation execution. The operation will also fail if more than one validation succeeds.

Note

Class OneOfWithRequiredFields in the example is a shortcut variant to generate a specification that represents the pseudo-code oneOf([<list-of-objects-with-same-base>]).

The real OpenAPI method to implement the above very commonly occurring situation is as presented by the following pseudo-code:

oneOf[allOf[RequiredByBoth, Variant1], allOf[RequiredByBoth, Variant2]]

This is both painful to read and is a lot of extra code to write when you actually expand it all into classes (each oneOf/allOf is another class). Class OneOfKeywordSchema will actually simplify this by automatically making the allOf definitions for you if it detects other schema nodes than oneOf specified in the class bases. You can still do the full oneOf/allOf classes expansion manually though, it will result into the same specification.

Warning

When oneOf/allOf automatic expansion occurs during schema generation

Warning

When calling deserialize(), because the validation process requires exactly one of the variants to succeed to consider the whole object to evaluate as valid, it is important to insert more permissive validators later in the _one_of iterator (or validator keyword). For example, having a variant with all fields defined as optional (ie: with missing=drop) inserted as first item in _one_of will make it always succeed regardless of following variants (since an empty schema with everything dropped is valid for optional-only elements). This would have as side effect of potentially failing the validation if other object are also valid depending on the received schema because the schema cannot be discriminated between many. If this occurs, it means the your schemas are too permissive.

In the event that you have very similar schemas that can sometime match except one identifier (e.g.: field type defining the type of object), consider adding a validator to each sub-node with explicit values to solve the discrimination problem.

As a shortcut, the OpenAPI keyword discriminator can be provided to try matching as a last resort.

For example:

class Animal(ExtendedMappingSchema):
    name = ExtendedSchemaNode(String())
    type = ExtendedSchemaNode(String())  # with explicit definition, this shouldn't be here

    ## With explicit definitions, each below 'Animal' class should be defined as follows
    ## type = ExtendedSchemaNode(String(), validator=colander.OneOf(['<animal>']))

class Cat(Animal):
    [...]   # many **OPTIONAL** fields

class Dog(Animal):
    [...]   # many **OPTIONAL** fields

# With the discriminator keyword, following is possible
class SomeAnimal(OneOfMappingSchema):
    discriminator = {
        "propertyName": "type",     # correspond to 'type' of 'Animal'
        "mapping": {
            "cat": Cat, "dog": Dog  # map expected values to target schemas
        }
    }
    _one_of = [
        Cat(),
        Dog(),
    ]

Note

Keyword discriminator supports a map of key-string to schemas-type as presented in the example, and the key must be located at the top level of the mapping. If only discriminator = "<field>" is provided, the definition will be created automatically using the example (which should be only the matching value) of the corresponding field of each node within the _one_of mapping.

When multiple valid schemas are matched against the input data, the error will be raised and returned with corresponding erroneous elements for each sub-schema (fully listed).

See also

  • AllOfKeywordSchema

  • AnyOfKeywordSchema

  • NotKeywordSchema

_one_of[source]
examples[source]
class weaver.wps_restapi.swagger_definitions.WPSHeaders(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

accept[source]
class weaver.wps_restapi.swagger_definitions.WPSEndpointGet(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

header[source]
querystring[source]
body[source]
class weaver.wps_restapi.swagger_definitions.WPSEndpointPost(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

header[source]
body[source]
class weaver.wps_restapi.swagger_definitions.XMLBooleanAttribute(*args, **kwargs)[source]

Combines all colander.SchemaNode extensions so that default keyword is used first to resolve a missing field value during deserialize() call, and then removes the node completely if no default was provided, and evaluate variables as needed.

See also

  • ExtendedMappingSchema

  • ExtendedSequenceSchema

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

schema_type[source]
attribute = True[source]
class weaver.wps_restapi.swagger_definitions.XMLString(*args, **kwargs)[source]

Combines all colander.SchemaNode extensions so that default keyword is used first to resolve a missing field value during deserialize() call, and then removes the node completely if no default was provided, and evaluate variables as needed.

See also

  • ExtendedMappingSchema

  • ExtendedSequenceSchema

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

schema_type[source]
class weaver.wps_restapi.swagger_definitions.OWSString(*args, **kwargs)[source]

Combines all colander.SchemaNode extensions so that default keyword is used first to resolve a missing field value during deserialize() call, and then removes the node completely if no default was provided, and evaluate variables as needed.

See also

  • ExtendedMappingSchema

  • ExtendedSequenceSchema

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

schema_type[source]
class weaver.wps_restapi.swagger_definitions.OWSKeywordList(*args, **kwargs)[source]

Combines DefaultSequenceSchema and DefaultSequenceSchema extensions so that default keyword is used first to resolve a missing sequence during deserialize() call, and then removes the node completely if no default was provided.

See also

  • ExtendedSchemaNode

  • ExtendedMappingSchema

title = OWSKeywords[source]
keyword[source]
class weaver.wps_restapi.swagger_definitions.OWSType(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

schema_type[source]
name = Type[source]
example = theme[source]
additionalProperties[source]
class weaver.wps_restapi.swagger_definitions.OWSPhone(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

name = Phone[source]
voice[source]
facsimile[source]
class weaver.wps_restapi.swagger_definitions.OWSAddress(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

name = Address[source]
delivery_point[source]
city[source]
country[source]
admin_area[source]
postal_code[source]
email[source]
class weaver.wps_restapi.swagger_definitions.OWSContactInfo(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

name = ContactInfo[source]
phone[source]
address[source]
class weaver.wps_restapi.swagger_definitions.OWSServiceContact(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

name = ServiceContact[source]
individual[source]
position[source]
contact[source]
class weaver.wps_restapi.swagger_definitions.OWSServiceProvider(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

description = Details about the institution providing the service.[source]
name = ServiceProvider[source]
title = ServiceProvider[source]
provider_name[source]
provider_site[source]
contact[source]
class weaver.wps_restapi.swagger_definitions.WPSDescriptionType(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

schema_ref = http://schemas.opengis.net/wps/1.0.0/common/DescriptionType.xsd[source]
name = DescriptionType[source]
_title[source]
abstract[source]
metadata[source]
class weaver.wps_restapi.swagger_definitions.OWSServiceIdentification(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

name = ServiceIdentification[source]
title = ServiceIdentification[source]
keywords[source]
type[source]
svc_type[source]
svc_type_ver1[source]
svc_type_ver2[source]
fees[source]
access[source]
provider[source]
class weaver.wps_restapi.swagger_definitions.OWSOperationName(*args, **kwargs)[source]

Combines all colander.SchemaNode extensions so that default keyword is used first to resolve a missing field value during deserialize() call, and then removes the node completely if no default was provided, and evaluate variables as needed.

See also

  • ExtendedMappingSchema

  • ExtendedSequenceSchema

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

schema_type[source]
attribute = True[source]
name = name[source]
example = GetCapabilities[source]
validator[source]

Combines all colander.SchemaNode extensions so that default keyword is used first to resolve a missing field value during deserialize() call, and then removes the node completely if no default was provided, and evaluate variables as needed.

See also

  • ExtendedMappingSchema

  • ExtendedSequenceSchema

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

schema_type[source]
attribute = True[source]
name = href[source]
prefix = xlink[source]
example = http://schema-example.com/wps[source]
class weaver.wps_restapi.swagger_definitions.OperationRequest(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

href[source]
class weaver.wps_restapi.swagger_definitions.OWS_HTTP(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

get[source]
post[source]
class weaver.wps_restapi.swagger_definitions.OWS_DCP(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

http[source]
https[source]
class weaver.wps_restapi.swagger_definitions.Operation(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

name[source]
dcp[source]
class weaver.wps_restapi.swagger_definitions.OperationsMetadata(*args, **kwargs)[source]

Combines DefaultSequenceSchema and DefaultSequenceSchema extensions so that default keyword is used first to resolve a missing sequence during deserialize() call, and then removes the node completely if no default was provided.

See also

  • ExtendedSchemaNode

  • ExtendedMappingSchema

name = OperationsMetadata[source]
op[source]
class weaver.wps_restapi.swagger_definitions.ProcessVersion(*args, **kwargs)[source]

Combines all colander.SchemaNode extensions so that default keyword is used first to resolve a missing field value during deserialize() call, and then removes the node completely if no default was provided, and evaluate variables as needed.

See also

  • ExtendedMappingSchema

  • ExtendedSequenceSchema

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

schema_type[source]
attribute = True[source]
class weaver.wps_restapi.swagger_definitions.OWSProcessSummary(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

version[source]
identifier[source]
_title[source]
abstract[source]
class weaver.wps_restapi.swagger_definitions.WPSProcessOfferings(*args, **kwargs)[source]

Combines DefaultSequenceSchema and DefaultSequenceSchema extensions so that default keyword is used first to resolve a missing sequence during deserialize() call, and then removes the node completely if no default was provided.

See also

  • ExtendedSchemaNode

  • ExtendedMappingSchema

name = ProcessOfferings[source]
title = ProcessOfferings[source]
process[source]
class weaver.wps_restapi.swagger_definitions.WPSLanguagesType(*args, **kwargs)[source]

Combines DefaultSequenceSchema and DefaultSequenceSchema extensions so that default keyword is used first to resolve a missing sequence during deserialize() call, and then removes the node completely if no default was provided.

See also

  • ExtendedSchemaNode

  • ExtendedMappingSchema

title = LanguagesType[source]
wrapped = False[source]
lang[source]
class weaver.wps_restapi.swagger_definitions.WPSLanguageSpecification(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

name = Languages[source]
title = Languages[source]
default[source]
supported[source]
class weaver.wps_restapi.swagger_definitions.WPSResponseBaseType(*args, **kwargs)[source]

Object schema that will allow any unknown field to remain present in the resulting deserialization.

This type is useful for defining a dictionary where some field names are not known in advance, or when more optional keys that don’t need to all be exhaustively provided in the schema are acceptable.

When doing schema deserialization to validate it, unknown keys would normally be removed without this class (default behaviour is to ignore them). With this schema, content under an unknown key is preserved as it was received without any validation. Other fields that are explicitly specified with sub-schema nodes will still be validated as per usual behaviour.

Example:

class AnyKeyObject(PermissiveMappingSchema):
    known_key = SchemaNode(String())

AnyKeyObject().deserialize({"unknown": "kept", "known_key": "requirement"}))
# result: dictionary returned as is instead of removing 'unknown' entry
#         'known_key' is still validated with its string schema

Note

This class is only a shorthand definition of unknown keyword for convenience. All colander.MappingSchema support this natively.

schema_ref = http://schemas.opengis.net/wps/1.0.0/common/ResponseBaseType.xsd[source]
service[source]
version[source]
lang[source]
class weaver.wps_restapi.swagger_definitions.WPSProcessVersion(*args, **kwargs)[source]

Combines all colander.SchemaNode extensions so that default keyword is used first to resolve a missing field value during deserialize() call, and then removes the node completely if no default was provided, and evaluate variables as needed.

See also

  • ExtendedMappingSchema

  • ExtendedSequenceSchema

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

schema_ref = http://schemas.opengis.net/wps/1.0.0/common/ProcessVersion.xsd[source]
schema_type[source]
description = Release version of this Process.[source]
name = processVersion[source]
attribute = True[source]
class weaver.wps_restapi.swagger_definitions.WPSInputDescriptionType(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

identifier[source]
_title[source]
abstract[source]
metadata[source]
class weaver.wps_restapi.swagger_definitions.WPSLiteralInputType(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

class weaver.wps_restapi.swagger_definitions.WPSLiteralData(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

name = LiteralData[source]
class weaver.wps_restapi.swagger_definitions.WPSCRSsType(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

crs[source]
class weaver.wps_restapi.swagger_definitions.WPSSupportedCRS(*args, **kwargs)[source]

Combines DefaultSequenceSchema and DefaultSequenceSchema extensions so that default keyword is used first to resolve a missing sequence during deserialize() call, and then removes the node completely if no default was provided.

See also

  • ExtendedSchemaNode

  • ExtendedMappingSchema

crs[source]
class weaver.wps_restapi.swagger_definitions.WPSSupportedCRSType(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

name = SupportedCRSsType[source]
default[source]
supported[source]
class weaver.wps_restapi.swagger_definitions.WPSBoundingBoxData(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

data[source]
class weaver.wps_restapi.swagger_definitions.WPSFormatDefinition(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

mime_type[source]
encoding[source]
schema[source]
class weaver.wps_restapi.swagger_definitions.WPSFileFormat(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

name = Format[source]
format[source]
class weaver.wps_restapi.swagger_definitions.WPSFormatList(*args, **kwargs)[source]

Combines DefaultSequenceSchema and DefaultSequenceSchema extensions so that default keyword is used first to resolve a missing sequence during deserialize() call, and then removes the node completely if no default was provided.

See also

  • ExtendedSchemaNode

  • ExtendedMappingSchema

format[source]
class weaver.wps_restapi.swagger_definitions.WPSComplexInputType(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

max_mb[source]
defaults[source]
supported[source]
class weaver.wps_restapi.swagger_definitions.WPSComplexData(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

data[source]
class weaver.wps_restapi.swagger_definitions.WPSInputFormChoice(*args, **kwargs)[source]

Allows specifying multiple supported mapping schemas variants for an underlying schema definition. Corresponds to the oneOf specifier of OpenAPI specification.

Example:

class Variant1(MappingSchema):
    [...fields of Variant1...]

class Variant2(MappingSchema):
    [...fields of Variant2...]

class RequiredByBoth(MappingSchema):
    [...fields required by both Variant1 and Variant2...]

class OneOfWithRequiredFields(OneOfKeywordSchema, RequiredByBoth):
    _one_of = (Variant1, Variant2)
    [...alternatively, field required by all variants here...]

In the above example, the validation (ie: deserialize) process will succeed if only one of the _one_of variants’ validator completely succeed, and will fail if every variant fails validation execution. The operation will also fail if more than one validation succeeds.

Note

Class OneOfWithRequiredFields in the example is a shortcut variant to generate a specification that represents the pseudo-code oneOf([<list-of-objects-with-same-base>]).

The real OpenAPI method to implement the above very commonly occurring situation is as presented by the following pseudo-code:

oneOf[allOf[RequiredByBoth, Variant1], allOf[RequiredByBoth, Variant2]]

This is both painful to read and is a lot of extra code to write when you actually expand it all into classes (each oneOf/allOf is another class). Class OneOfKeywordSchema will actually simplify this by automatically making the allOf definitions for you if it detects other schema nodes than oneOf specified in the class bases. You can still do the full oneOf/allOf classes expansion manually though, it will result into the same specification.

Warning

When oneOf/allOf automatic expansion occurs during schema generation

Warning

When calling deserialize(), because the validation process requires exactly one of the variants to succeed to consider the whole object to evaluate as valid, it is important to insert more permissive validators later in the _one_of iterator (or validator keyword). For example, having a variant with all fields defined as optional (ie: with missing=drop) inserted as first item in _one_of will make it always succeed regardless of following variants (since an empty schema with everything dropped is valid for optional-only elements). This would have as side effect of potentially failing the validation if other object are also valid depending on the received schema because the schema cannot be discriminated between many. If this occurs, it means the your schemas are too permissive.

In the event that you have very similar schemas that can sometime match except one identifier (e.g.: field type defining the type of object), consider adding a validator to each sub-node with explicit values to solve the discrimination problem.

As a shortcut, the OpenAPI keyword discriminator can be provided to try matching as a last resort.

For example:

class Animal(ExtendedMappingSchema):
    name = ExtendedSchemaNode(String())
    type = ExtendedSchemaNode(String())  # with explicit definition, this shouldn't be here

    ## With explicit definitions, each below 'Animal' class should be defined as follows
    ## type = ExtendedSchemaNode(String(), validator=colander.OneOf(['<animal>']))

class Cat(Animal):
    [...]   # many **OPTIONAL** fields

class Dog(Animal):
    [...]   # many **OPTIONAL** fields

# With the discriminator keyword, following is possible
class SomeAnimal(OneOfMappingSchema):
    discriminator = {
        "propertyName": "type",     # correspond to 'type' of 'Animal'
        "mapping": {
            "cat": Cat, "dog": Dog  # map expected values to target schemas
        }
    }
    _one_of = [
        Cat(),
        Dog(),
    ]

Note

Keyword discriminator supports a map of key-string to schemas-type as presented in the example, and the key must be located at the top level of the mapping. If only discriminator = "<field>" is provided, the definition will be created automatically using the example (which should be only the matching value) of the corresponding field of each node within the _one_of mapping.

When multiple valid schemas are matched against the input data, the error will be raised and returned with corresponding erroneous elements for each sub-schema (fully listed).

See also

  • AllOfKeywordSchema

  • AnyOfKeywordSchema

  • NotKeywordSchema

title = InputFormChoice[source]
_one_of[source]
class weaver.wps_restapi.swagger_definitions.WPSMinOccursAttribute(*args, **kwargs)[source]

Allows specifying multiple supported mapping schemas variants for an underlying schema definition. Corresponds to the oneOf specifier of OpenAPI specification.

Example:

class Variant1(MappingSchema):
    [...fields of Variant1...]

class Variant2(MappingSchema):
    [...fields of Variant2...]

class RequiredByBoth(MappingSchema):
    [...fields required by both Variant1 and Variant2...]

class OneOfWithRequiredFields(OneOfKeywordSchema, RequiredByBoth):
    _one_of = (Variant1, Variant2)
    [...alternatively, field required by all variants here...]

In the above example, the validation (ie: deserialize) process will succeed if only one of the _one_of variants’ validator completely succeed, and will fail if every variant fails validation execution. The operation will also fail if more than one validation succeeds.

Note

Class OneOfWithRequiredFields in the example is a shortcut variant to generate a specification that represents the pseudo-code oneOf([<list-of-objects-with-same-base>]).

The real OpenAPI method to implement the above very commonly occurring situation is as presented by the following pseudo-code:

oneOf[allOf[RequiredByBoth, Variant1], allOf[RequiredByBoth, Variant2]]

This is both painful to read and is a lot of extra code to write when you actually expand it all into classes (each oneOf/allOf is another class). Class OneOfKeywordSchema will actually simplify this by automatically making the allOf definitions for you if it detects other schema nodes than oneOf specified in the class bases. You can still do the full oneOf/allOf classes expansion manually though, it will result into the same specification.

Warning

When oneOf/allOf automatic expansion occurs during schema generation

Warning

When calling deserialize(), because the validation process requires exactly one of the variants to succeed to consider the whole object to evaluate as valid, it is important to insert more permissive validators later in the _one_of iterator (or validator keyword). For example, having a variant with all fields defined as optional (ie: with missing=drop) inserted as first item in _one_of will make it always succeed regardless of following variants (since an empty schema with everything dropped is valid for optional-only elements). This would have as side effect of potentially failing the validation if other object are also valid depending on the received schema because the schema cannot be discriminated between many. If this occurs, it means the your schemas are too permissive.

In the event that you have very similar schemas that can sometime match except one identifier (e.g.: field type defining the type of object), consider adding a validator to each sub-node with explicit values to solve the discrimination problem.

As a shortcut, the OpenAPI keyword discriminator can be provided to try matching as a last resort.

For example:

class Animal(ExtendedMappingSchema):
    name = ExtendedSchemaNode(String())
    type = ExtendedSchemaNode(String())  # with explicit definition, this shouldn't be here

    ## With explicit definitions, each below 'Animal' class should be defined as follows
    ## type = ExtendedSchemaNode(String(), validator=colander.OneOf(['<animal>']))

class Cat(Animal):
    [...]   # many **OPTIONAL** fields

class Dog(Animal):
    [...]   # many **OPTIONAL** fields

# With the discriminator keyword, following is possible
class SomeAnimal(OneOfMappingSchema):
    discriminator = {
        "propertyName": "type",     # correspond to 'type' of 'Animal'
        "mapping": {
            "cat": Cat, "dog": Dog  # map expected values to target schemas
        }
    }
    _one_of = [
        Cat(),
        Dog(),
    ]

Note

Keyword discriminator supports a map of key-string to schemas-type as presented in the example, and the key must be located at the top level of the mapping. If only discriminator = "<field>" is provided, the definition will be created automatically using the example (which should be only the matching value) of the corresponding field of each node within the _one_of mapping.

When multiple valid schemas are matched against the input data, the error will be raised and returned with corresponding erroneous elements for each sub-schema (fully listed).

See also

  • AllOfKeywordSchema

  • AnyOfKeywordSchema

  • NotKeywordSchema

name = minOccurs[source]
attribute = True[source]
class weaver.wps_restapi.swagger_definitions.WPSMaxOccursAttribute(*args, **kwargs)[source]

Allows specifying multiple supported mapping schemas variants for an underlying schema definition. Corresponds to the oneOf specifier of OpenAPI specification.

Example:

class Variant1(MappingSchema):
    [...fields of Variant1...]

class Variant2(MappingSchema):
    [...fields of Variant2...]

class RequiredByBoth(MappingSchema):
    [...fields required by both Variant1 and Variant2...]

class OneOfWithRequiredFields(OneOfKeywordSchema, RequiredByBoth):
    _one_of = (Variant1, Variant2)
    [...alternatively, field required by all variants here...]

In the above example, the validation (ie: deserialize) process will succeed if only one of the _one_of variants’ validator completely succeed, and will fail if every variant fails validation execution. The operation will also fail if more than one validation succeeds.

Note

Class OneOfWithRequiredFields in the example is a shortcut variant to generate a specification that represents the pseudo-code oneOf([<list-of-objects-with-same-base>]).

The real OpenAPI method to implement the above very commonly occurring situation is as presented by the following pseudo-code:

oneOf[allOf[RequiredByBoth, Variant1], allOf[RequiredByBoth, Variant2]]

This is both painful to read and is a lot of extra code to write when you actually expand it all into classes (each oneOf/allOf is another class). Class OneOfKeywordSchema will actually simplify this by automatically making the allOf definitions for you if it detects other schema nodes than oneOf specified in the class bases. You can still do the full oneOf/allOf classes expansion manually though, it will result into the same specification.

Warning

When oneOf/allOf automatic expansion occurs during schema generation

Warning

When calling deserialize(), because the validation process requires exactly one of the variants to succeed to consider the whole object to evaluate as valid, it is important to insert more permissive validators later in the _one_of iterator (or validator keyword). For example, having a variant with all fields defined as optional (ie: with missing=drop) inserted as first item in _one_of will make it always succeed regardless of following variants (since an empty schema with everything dropped is valid for optional-only elements). This would have as side effect of potentially failing the validation if other object are also valid depending on the received schema because the schema cannot be discriminated between many. If this occurs, it means the your schemas are too permissive.

In the event that you have very similar schemas that can sometime match except one identifier (e.g.: field type defining the type of object), consider adding a validator to each sub-node with explicit values to solve the discrimination problem.

As a shortcut, the OpenAPI keyword discriminator can be provided to try matching as a last resort.

For example:

class Animal(ExtendedMappingSchema):
    name = ExtendedSchemaNode(String())
    type = ExtendedSchemaNode(String())  # with explicit definition, this shouldn't be here

    ## With explicit definitions, each below 'Animal' class should be defined as follows
    ## type = ExtendedSchemaNode(String(), validator=colander.OneOf(['<animal>']))

class Cat(Animal):
    [...]   # many **OPTIONAL** fields

class Dog(Animal):
    [...]   # many **OPTIONAL** fields

# With the discriminator keyword, following is possible
class SomeAnimal(OneOfMappingSchema):
    discriminator = {
        "propertyName": "type",     # correspond to 'type' of 'Animal'
        "mapping": {
            "cat": Cat, "dog": Dog  # map expected values to target schemas
        }
    }
    _one_of = [
        Cat(),
        Dog(),
    ]

Note

Keyword discriminator supports a map of key-string to schemas-type as presented in the example, and the key must be located at the top level of the mapping. If only discriminator = "<field>" is provided, the definition will be created automatically using the example (which should be only the matching value) of the corresponding field of each node within the _one_of mapping.

When multiple valid schemas are matched against the input data, the error will be raised and returned with corresponding erroneous elements for each sub-schema (fully listed).

See also

  • AllOfKeywordSchema

  • AnyOfKeywordSchema

  • NotKeywordSchema

name = maxOccurs[source]
prefix[source]
attribute = True[source]
class weaver.wps_restapi.swagger_definitions.WPSDataInputDescription(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

min_occurs[source]
max_occurs[source]
class weaver.wps_restapi.swagger_definitions.WPSDataInputItem(*args, **kwargs)[source]

Allows specifying all the required partial mapping schemas for an underlying complete schema definition. Corresponds to the allOf specifier of OpenAPI specification.

Example:

class RequiredItem(ExtendedMappingSchema):
    item = ExtendedSchemaNode(String())

class RequiredType(ExtendedMappingSchema):
    type = ExtendedSchemaNode(String())

class AllRequired(AnyKeywordSchema):
    _all_of = [RequiredItem(), RequiredType()]

Value parsed with schema this definition will be valid only when every since one of the sub-schemas is valid. Any sub-schema raising an invalid error for any reason with make the whole schema validation fail.

See also

  • OneOfKeywordSchema

  • AnyOfKeywordSchema

  • NotKeywordSchema

_all_of[source]
class weaver.wps_restapi.swagger_definitions.WPSDataInputs(*args, **kwargs)[source]

Combines DefaultSequenceSchema and DefaultSequenceSchema extensions so that default keyword is used first to resolve a missing sequence during deserialize() call, and then removes the node completely if no default was provided.

See also

  • ExtendedSchemaNode

  • ExtendedMappingSchema

name = DataInputs[source]
title = DataInputs[source]
input[source]
class weaver.wps_restapi.swagger_definitions.WPSOutputDescriptionType(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

name = OutputDescriptionType[source]
title = OutputDescriptionType[source]
identifier[source]
_title[source]
abstract[source]
metadata[source]
class weaver.wps_restapi.swagger_definitions.ProcessOutputs(*args, **kwargs)[source]

Combines DefaultSequenceSchema and DefaultSequenceSchema extensions so that default keyword is used first to resolve a missing sequence during deserialize() call, and then removes the node completely if no default was provided.

See also

  • ExtendedSchemaNode

  • ExtendedMappingSchema

name = ProcessOutputs[source]
title = ProcessOutputs[source]
output[source]
class weaver.wps_restapi.swagger_definitions.WPSGetCapabilities(*args, **kwargs)[source]

Object schema that will allow any unknown field to remain present in the resulting deserialization.

This type is useful for defining a dictionary where some field names are not known in advance, or when more optional keys that don’t need to all be exhaustively provided in the schema are acceptable.

When doing schema deserialization to validate it, unknown keys would normally be removed without this class (default behaviour is to ignore them). With this schema, content under an unknown key is preserved as it was received without any validation. Other fields that are explicitly specified with sub-schema nodes will still be validated as per usual behaviour.

Example:

class AnyKeyObject(PermissiveMappingSchema):
    known_key = SchemaNode(String())

AnyKeyObject().deserialize({"unknown": "kept", "known_key": "requirement"}))
# result: dictionary returned as is instead of removing 'unknown' entry
#         'known_key' is still validated with its string schema

Note

This class is only a shorthand definition of unknown keyword for convenience. All colander.MappingSchema support this natively.

schema_ref = http://schemas.opengis.net/wps/1.0.0/wpsGetCapabilities_response.xsd[source]
name = Capabilities[source]
title = Capabilities[source]
svc[source]
ops[source]
offering[source]
languages[source]
class weaver.wps_restapi.swagger_definitions.WPSProcessDescriptionType(*args, **kwargs)[source]

Object schema that will allow any unknown field to remain present in the resulting deserialization.

This type is useful for defining a dictionary where some field names are not known in advance, or when more optional keys that don’t need to all be exhaustively provided in the schema are acceptable.

When doing schema deserialization to validate it, unknown keys would normally be removed without this class (default behaviour is to ignore them). With this schema, content under an unknown key is preserved as it was received without any validation. Other fields that are explicitly specified with sub-schema nodes will still be validated as per usual behaviour.

Example:

class AnyKeyObject(PermissiveMappingSchema):
    known_key = SchemaNode(String())

AnyKeyObject().deserialize({"unknown": "kept", "known_key": "requirement"}))
# result: dictionary returned as is instead of removing 'unknown' entry
#         'known_key' is still validated with its string schema

Note

This class is only a shorthand definition of unknown keyword for convenience. All colander.MappingSchema support this natively.

name = ProcessDescriptionType[source]
description = Description of the requested process by identifier.[source]
store[source]
status[source]
inputs[source]
outputs[source]
class weaver.wps_restapi.swagger_definitions.WPSProcessDescriptionList(*args, **kwargs)[source]

Combines DefaultSequenceSchema and DefaultSequenceSchema extensions so that default keyword is used first to resolve a missing sequence during deserialize() call, and then removes the node completely if no default was provided.

See also

  • ExtendedSchemaNode

  • ExtendedMappingSchema

name = ProcessDescriptions[source]
title = ProcessDescriptions[source]
description = Listing of process description for every requested identifier.[source]
wrapped = False[source]
process[source]
class weaver.wps_restapi.swagger_definitions.WPSDescribeProcess(*args, **kwargs)[source]

Object schema that will allow any unknown field to remain present in the resulting deserialization.

This type is useful for defining a dictionary where some field names are not known in advance, or when more optional keys that don’t need to all be exhaustively provided in the schema are acceptable.

When doing schema deserialization to validate it, unknown keys would normally be removed without this class (default behaviour is to ignore them). With this schema, content under an unknown key is preserved as it was received without any validation. Other fields that are explicitly specified with sub-schema nodes will still be validated as per usual behaviour.

Example:

class AnyKeyObject(PermissiveMappingSchema):
    known_key = SchemaNode(String())

AnyKeyObject().deserialize({"unknown": "kept", "known_key": "requirement"}))
# result: dictionary returned as is instead of removing 'unknown' entry
#         'known_key' is still validated with its string schema

Note

This class is only a shorthand definition of unknown keyword for convenience. All colander.MappingSchema support this natively.

schema_ref = http://schemas.opengis.net/wps/1.0.0/wpsDescribeProcess_response.xsd[source]
name = DescribeProcess[source]
title = DescribeProcess[source]
process[source]
class weaver.wps_restapi.swagger_definitions.WPSStatusLocationAttribute(*args, **kwargs)[source]

Combines all colander.SchemaNode extensions so that default keyword is used first to resolve a missing field value during deserialize() call, and then removes the node completely if no default was provided, and evaluate variables as needed.

See also

  • ExtendedMappingSchema

  • ExtendedSequenceSchema

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

schema_type[source]
name = statusLocation[source]
prefix[source]
attribute = True[source]
format = file[source]
class weaver.wps_restapi.swagger_definitions.WPSServiceInstanceAttribute(*args, **kwargs)[source]

Combines all colander.SchemaNode extensions so that default keyword is used first to resolve a missing field value during deserialize() call, and then removes the node completely if no default was provided, and evaluate variables as needed.

See also

  • ExtendedMappingSchema

  • ExtendedSequenceSchema

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

schema_type[source]
name = serviceInstance[source]
prefix[source]
attribute = True[source]
format = url[source]
class weaver.wps_restapi.swagger_definitions.CreationTimeAttribute(*args, **kwargs)[source]

Combines all colander.SchemaNode extensions so that default keyword is used first to resolve a missing field value during deserialize() call, and then removes the node completely if no default was provided, and evaluate variables as needed.

See also

  • ExtendedMappingSchema

  • ExtendedSequenceSchema

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

schema_type[source]
name = creationTime[source]
title = CreationTime[source]
prefix[source]
attribute = True[source]
class weaver.wps_restapi.swagger_definitions.WPSStatusSuccess(*args, **kwargs)[source]

Combines all colander.SchemaNode extensions so that default keyword is used first to resolve a missing field value during deserialize() call, and then removes the node completely if no default was provided, and evaluate variables as needed.

See also

  • ExtendedMappingSchema

  • ExtendedSequenceSchema

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

schema_type[source]
name = ProcessSucceeded[source]
title = ProcessSucceeded[source]
class weaver.wps_restapi.swagger_definitions.WPSStatusFailed(*args, **kwargs)[source]

Combines all colander.SchemaNode extensions so that default keyword is used first to resolve a missing field value during deserialize() call, and then removes the node completely if no default was provided, and evaluate variables as needed.

See also

  • ExtendedMappingSchema

  • ExtendedSequenceSchema

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

schema_type[source]
name = ProcessFailed[source]
title = ProcessFailed[source]
class weaver.wps_restapi.swagger_definitions.WPSStatus(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

name = Status[source]
title = Status[source]
creationTime[source]
status_success[source]
status_failed[source]
class weaver.wps_restapi.swagger_definitions.WPSProcessSummary(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

name = Process[source]
title = Process[source]
identifier[source]
_title[source]
abstract[source]
class weaver.wps_restapi.swagger_definitions.WPSOutputBase(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

identifier[source]
_title[source]
abstract[source]
class weaver.wps_restapi.swagger_definitions.WPSOutputDefinitionItem(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

name = Output[source]
title = OutputDefinition[source]
class weaver.wps_restapi.swagger_definitions.WPSOutputDefinitions(*args, **kwargs)[source]

Combines DefaultSequenceSchema and DefaultSequenceSchema extensions so that default keyword is used first to resolve a missing sequence during deserialize() call, and then removes the node completely if no default was provided.

See also

  • ExtendedSchemaNode

  • ExtendedMappingSchema

name = OutputDefinitions[source]
title = OutputDefinitions[source]
out_def[source]
class weaver.wps_restapi.swagger_definitions.WPSOutputLiteral(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

data = [][source]
class weaver.wps_restapi.swagger_definitions.WPSReference(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

href[source]
mimeType[source]
encoding[source]
class weaver.wps_restapi.swagger_definitions.WPSOutputReference(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

title = OutputReference[source]
reference[source]
class weaver.wps_restapi.swagger_definitions.WPSOutputData(*args, **kwargs)[source]

Allows specifying multiple supported mapping schemas variants for an underlying schema definition. Corresponds to the oneOf specifier of OpenAPI specification.

Example:

class Variant1(MappingSchema):
    [...fields of Variant1...]

class Variant2(MappingSchema):
    [...fields of Variant2...]

class RequiredByBoth(MappingSchema):
    [...fields required by both Variant1 and Variant2...]

class OneOfWithRequiredFields(OneOfKeywordSchema, RequiredByBoth):
    _one_of = (Variant1, Variant2)
    [...alternatively, field required by all variants here...]

In the above example, the validation (ie: deserialize) process will succeed if only one of the _one_of variants’ validator completely succeed, and will fail if every variant fails validation execution. The operation will also fail if more than one validation succeeds.

Note

Class OneOfWithRequiredFields in the example is a shortcut variant to generate a specification that represents the pseudo-code oneOf([<list-of-objects-with-same-base>]).

The real OpenAPI method to implement the above very commonly occurring situation is as presented by the following pseudo-code:

oneOf[allOf[RequiredByBoth, Variant1], allOf[RequiredByBoth, Variant2]]

This is both painful to read and is a lot of extra code to write when you actually expand it all into classes (each oneOf/allOf is another class). Class OneOfKeywordSchema will actually simplify this by automatically making the allOf definitions for you if it detects other schema nodes than oneOf specified in the class bases. You can still do the full oneOf/allOf classes expansion manually though, it will result into the same specification.

Warning

When oneOf/allOf automatic expansion occurs during schema generation

Warning

When calling deserialize(), because the validation process requires exactly one of the variants to succeed to consider the whole object to evaluate as valid, it is important to insert more permissive validators later in the _one_of iterator (or validator keyword). For example, having a variant with all fields defined as optional (ie: with missing=drop) inserted as first item in _one_of will make it always succeed regardless of following variants (since an empty schema with everything dropped is valid for optional-only elements). This would have as side effect of potentially failing the validation if other object are also valid depending on the received schema because the schema cannot be discriminated between many. If this occurs, it means the your schemas are too permissive.

In the event that you have very similar schemas that can sometime match except one identifier (e.g.: field type defining the type of object), consider adding a validator to each sub-node with explicit values to solve the discrimination problem.

As a shortcut, the OpenAPI keyword discriminator can be provided to try matching as a last resort.

For example:

class Animal(ExtendedMappingSchema):
    name = ExtendedSchemaNode(String())
    type = ExtendedSchemaNode(String())  # with explicit definition, this shouldn't be here

    ## With explicit definitions, each below 'Animal' class should be defined as follows
    ## type = ExtendedSchemaNode(String(), validator=colander.OneOf(['<animal>']))

class Cat(Animal):
    [...]   # many **OPTIONAL** fields

class Dog(Animal):
    [...]   # many **OPTIONAL** fields

# With the discriminator keyword, following is possible
class SomeAnimal(OneOfMappingSchema):
    discriminator = {
        "propertyName": "type",     # correspond to 'type' of 'Animal'
        "mapping": {
            "cat": Cat, "dog": Dog  # map expected values to target schemas
        }
    }
    _one_of = [
        Cat(),
        Dog(),
    ]

Note

Keyword discriminator supports a map of key-string to schemas-type as presented in the example, and the key must be located at the top level of the mapping. If only discriminator = "<field>" is provided, the definition will be created automatically using the example (which should be only the matching value) of the corresponding field of each node within the _one_of mapping.

When multiple valid schemas are matched against the input data, the error will be raised and returned with corresponding erroneous elements for each sub-schema (fully listed).

See also

  • AllOfKeywordSchema

  • AnyOfKeywordSchema

  • NotKeywordSchema

_one_of[source]
class weaver.wps_restapi.swagger_definitions.WPSDataOutputItem(*args, **kwargs)[source]

Allows specifying all the required partial mapping schemas for an underlying complete schema definition. Corresponds to the allOf specifier of OpenAPI specification.

Example:

class RequiredItem(ExtendedMappingSchema):
    item = ExtendedSchemaNode(String())

class RequiredType(ExtendedMappingSchema):
    type = ExtendedSchemaNode(String())

class AllRequired(AnyKeywordSchema):
    _all_of = [RequiredItem(), RequiredType()]

Value parsed with schema this definition will be valid only when every since one of the sub-schemas is valid. Any sub-schema raising an invalid error for any reason with make the whole schema validation fail.

See also

  • OneOfKeywordSchema

  • AnyOfKeywordSchema

  • NotKeywordSchema

name = Output[source]
title = DataOutput[source]
_all_of[source]
class weaver.wps_restapi.swagger_definitions.WPSProcessOutputs(*args, **kwargs)[source]

Combines DefaultSequenceSchema and DefaultSequenceSchema extensions so that default keyword is used first to resolve a missing sequence during deserialize() call, and then removes the node completely if no default was provided.

See also

  • ExtendedSchemaNode

  • ExtendedMappingSchema

name = ProcessOutputs[source]
title = ProcessOutputs[source]
output[source]
class weaver.wps_restapi.swagger_definitions.WPSExecuteResponse(*args, **kwargs)[source]

Object schema that will allow any unknown field to remain present in the resulting deserialization.

This type is useful for defining a dictionary where some field names are not known in advance, or when more optional keys that don’t need to all be exhaustively provided in the schema are acceptable.

When doing schema deserialization to validate it, unknown keys would normally be removed without this class (default behaviour is to ignore them). With this schema, content under an unknown key is preserved as it was received without any validation. Other fields that are explicitly specified with sub-schema nodes will still be validated as per usual behaviour.

Example:

class AnyKeyObject(PermissiveMappingSchema):
    known_key = SchemaNode(String())

AnyKeyObject().deserialize({"unknown": "kept", "known_key": "requirement"}))
# result: dictionary returned as is instead of removing 'unknown' entry
#         'known_key' is still validated with its string schema

Note

This class is only a shorthand definition of unknown keyword for convenience. All colander.MappingSchema support this natively.

schema_ref = http://schemas.opengis.net/wps/1.0.0/wpsExecute_response.xsd[source]
name = ExecuteResponse[source]
title = ExecuteResponse[source]
location[source]
svc_loc[source]
process[source]
status[source]
inputs[source]
out_def[source]
outputs[source]
class weaver.wps_restapi.swagger_definitions.WPSXMLSuccessBodySchema(*args, **kwargs)[source]

Allows specifying multiple supported mapping schemas variants for an underlying schema definition. Corresponds to the oneOf specifier of OpenAPI specification.

Example:

class Variant1(MappingSchema):
    [...fields of Variant1...]

class Variant2(MappingSchema):
    [...fields of Variant2...]

class RequiredByBoth(MappingSchema):
    [...fields required by both Variant1 and Variant2...]

class OneOfWithRequiredFields(OneOfKeywordSchema, RequiredByBoth):
    _one_of = (Variant1, Variant2)
    [...alternatively, field required by all variants here...]

In the above example, the validation (ie: deserialize) process will succeed if only one of the _one_of variants’ validator completely succeed, and will fail if every variant fails validation execution. The operation will also fail if more than one validation succeeds.

Note

Class OneOfWithRequiredFields in the example is a shortcut variant to generate a specification that represents the pseudo-code oneOf([<list-of-objects-with-same-base>]).

The real OpenAPI method to implement the above very commonly occurring situation is as presented by the following pseudo-code:

oneOf[allOf[RequiredByBoth, Variant1], allOf[RequiredByBoth, Variant2]]

This is both painful to read and is a lot of extra code to write when you actually expand it all into classes (each oneOf/allOf is another class). Class OneOfKeywordSchema will actually simplify this by automatically making the allOf definitions for you if it detects other schema nodes than oneOf specified in the class bases. You can still do the full oneOf/allOf classes expansion manually though, it will result into the same specification.

Warning

When oneOf/allOf automatic expansion occurs during schema generation

Warning

When calling deserialize(), because the validation process requires exactly one of the variants to succeed to consider the whole object to evaluate as valid, it is important to insert more permissive validators later in the _one_of iterator (or validator keyword). For example, having a variant with all fields defined as optional (ie: with missing=drop) inserted as first item in _one_of will make it always succeed regardless of following variants (since an empty schema with everything dropped is valid for optional-only elements). This would have as side effect of potentially failing the validation if other object are also valid depending on the received schema because the schema cannot be discriminated between many. If this occurs, it means the your schemas are too permissive.

In the event that you have very similar schemas that can sometime match except one identifier (e.g.: field type defining the type of object), consider adding a validator to each sub-node with explicit values to solve the discrimination problem.

As a shortcut, the OpenAPI keyword discriminator can be provided to try matching as a last resort.

For example:

class Animal(ExtendedMappingSchema):
    name = ExtendedSchemaNode(String())
    type = ExtendedSchemaNode(String())  # with explicit definition, this shouldn't be here

    ## With explicit definitions, each below 'Animal' class should be defined as follows
    ## type = ExtendedSchemaNode(String(), validator=colander.OneOf(['<animal>']))

class Cat(Animal):
    [...]   # many **OPTIONAL** fields

class Dog(Animal):
    [...]   # many **OPTIONAL** fields

# With the discriminator keyword, following is possible
class SomeAnimal(OneOfMappingSchema):
    discriminator = {
        "propertyName": "type",     # correspond to 'type' of 'Animal'
        "mapping": {
            "cat": Cat, "dog": Dog  # map expected values to target schemas
        }
    }
    _one_of = [
        Cat(),
        Dog(),
    ]

Note

Keyword discriminator supports a map of key-string to schemas-type as presented in the example, and the key must be located at the top level of the mapping. If only discriminator = "<field>" is provided, the definition will be created automatically using the example (which should be only the matching value) of the corresponding field of each node within the _one_of mapping.

When multiple valid schemas are matched against the input data, the error will be raised and returned with corresponding erroneous elements for each sub-schema (fully listed).

See also

  • AllOfKeywordSchema

  • AnyOfKeywordSchema

  • NotKeywordSchema

_one_of[source]
class weaver.wps_restapi.swagger_definitions.OWSExceptionCodeAttribute(*args, **kwargs)[source]

Combines all colander.SchemaNode extensions so that default keyword is used first to resolve a missing field value during deserialize() call, and then removes the node completely if no default was provided, and evaluate variables as needed.

See also

  • ExtendedMappingSchema

  • ExtendedSequenceSchema

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

schema_type[source]
name = exceptionCode[source]
title = Exception[source]
attribute = True[source]
class weaver.wps_restapi.swagger_definitions.OWSExceptionLocatorAttribute(*args, **kwargs)[source]

Combines all colander.SchemaNode extensions so that default keyword is used first to resolve a missing field value during deserialize() call, and then removes the node completely if no default was provided, and evaluate variables as needed.

See also

  • ExtendedMappingSchema

  • ExtendedSequenceSchema

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

schema_type[source]
name = locator[source]
attribute = True[source]
class weaver.wps_restapi.swagger_definitions.OWSExceptionText(*args, **kwargs)[source]

Combines all colander.SchemaNode extensions so that default keyword is used first to resolve a missing field value during deserialize() call, and then removes the node completely if no default was provided, and evaluate variables as needed.

See also

  • ExtendedMappingSchema

  • ExtendedSequenceSchema

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

schema_type[source]
name = ExceptionText[source]
class weaver.wps_restapi.swagger_definitions.OWSException(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

name = Exception[source]
title = Exception[source]
code[source]
locator[source]
text[source]
class weaver.wps_restapi.swagger_definitions.OWSExceptionReport(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

name = ExceptionReport[source]
title = ExceptionReport[source]
exception[source]
class weaver.wps_restapi.swagger_definitions.WPSException(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

report[source]
class weaver.wps_restapi.swagger_definitions.OkWPSResponse(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

description = WPS operation successful[source]
header[source]
body[source]
class weaver.wps_restapi.swagger_definitions.ErrorWPSResponse(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

description = Unhandled error occurred on WPS endpoint.[source]
header[source]
body[source]
class weaver.wps_restapi.swagger_definitions.ProviderEndpoint(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

header[source]
class weaver.wps_restapi.swagger_definitions.ProviderProcessEndpoint(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

header[source]
class weaver.wps_restapi.swagger_definitions.ProcessEndpoint(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

header[source]
class weaver.wps_restapi.swagger_definitions.ProcessPackageEndpoint(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

header[source]
class weaver.wps_restapi.swagger_definitions.ProcessPayloadEndpoint(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

header[source]
class weaver.wps_restapi.swagger_definitions.ProcessVisibilityGetEndpoint(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

header[source]
class weaver.wps_restapi.swagger_definitions.ProcessVisibilityPutEndpoint(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

header[source]
body[source]
class weaver.wps_restapi.swagger_definitions.ProviderJobEndpoint(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

header[source]
class weaver.wps_restapi.swagger_definitions.JobEndpoint(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

header[source]
class weaver.wps_restapi.swagger_definitions.ProcessInputsEndpoint(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

header[source]
class weaver.wps_restapi.swagger_definitions.ProviderInputsEndpoint(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

header[source]
class weaver.wps_restapi.swagger_definitions.JobInputsEndpoint(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

header[source]
class weaver.wps_restapi.swagger_definitions.ProcessOutputsEndpoint(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

header[source]
class weaver.wps_restapi.swagger_definitions.ProviderOutputsEndpoint(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

header[source]
class weaver.wps_restapi.swagger_definitions.JobOutputsEndpoint(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

header[source]
class weaver.wps_restapi.swagger_definitions.ProcessResultEndpoint(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

deprecated = True[source]
header[source]
class weaver.wps_restapi.swagger_definitions.ProviderResultEndpoint(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

deprecated = True[source]
header[source]
class weaver.wps_restapi.swagger_definitions.JobResultEndpoint(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

deprecated = True[source]
header[source]
class weaver.wps_restapi.swagger_definitions.ProcessResultsEndpoint(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

header[source]
class weaver.wps_restapi.swagger_definitions.ProviderResultsEndpoint(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

header[source]
class weaver.wps_restapi.swagger_definitions.JobResultsEndpoint(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

header[source]
class weaver.wps_restapi.swagger_definitions.ProviderExceptionsEndpoint(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

header[source]
class weaver.wps_restapi.swagger_definitions.JobExceptionsEndpoint(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

header[source]
class weaver.wps_restapi.swagger_definitions.ProcessExceptionsEndpoint(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

header[source]
class weaver.wps_restapi.swagger_definitions.ProviderLogsEndpoint(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

header[source]
class weaver.wps_restapi.swagger_definitions.JobLogsEndpoint(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

header[source]
class weaver.wps_restapi.swagger_definitions.ProcessLogsEndpoint(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

header[source]
class weaver.wps_restapi.swagger_definitions.CreateProviderRequestBody(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

id[source]
url[source]
public[source]
class weaver.wps_restapi.swagger_definitions.InputDataType(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

class weaver.wps_restapi.swagger_definitions.OutputDataType(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

format[source]
class weaver.wps_restapi.swagger_definitions.Output(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

transmissionMode[source]
class weaver.wps_restapi.swagger_definitions.OutputList(*args, **kwargs)[source]

Combines DefaultSequenceSchema and DefaultSequenceSchema extensions so that default keyword is used first to resolve a missing sequence during deserialize() call, and then removes the node completely if no default was provided.

See also

  • ExtendedSchemaNode

  • ExtendedMappingSchema

output[source]
class weaver.wps_restapi.swagger_definitions.ProviderSummarySchema(*args, **kwargs)[source]

WPS provider summary definition.

id[source]
url[source]
title[source]
abstract[source]
public[source]
class weaver.wps_restapi.swagger_definitions.ProviderCapabilitiesSchema(*args, **kwargs)[source]

WPS provider capabilities.

id[source]
url[source]
title[source]
abstract[source]
contact[source]
type[source]
class weaver.wps_restapi.swagger_definitions.TransmissionModeList(*args, **kwargs)[source]

Combines DefaultSequenceSchema and DefaultSequenceSchema extensions so that default keyword is used first to resolve a missing sequence during deserialize() call, and then removes the node completely if no default was provided.

See also

  • ExtendedSchemaNode

  • ExtendedMappingSchema

transmissionMode[source]
class weaver.wps_restapi.swagger_definitions.JobControlOptionsList(*args, **kwargs)[source]

Combines DefaultSequenceSchema and DefaultSequenceSchema extensions so that default keyword is used first to resolve a missing sequence during deserialize() call, and then removes the node completely if no default was provided.

See also

  • ExtendedSchemaNode

  • ExtendedMappingSchema

jobControlOption[source]
class weaver.wps_restapi.swagger_definitions.ExceptionReportType(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

code[source]
description[source]
class weaver.wps_restapi.swagger_definitions.ProcessSummary(*args, **kwargs)[source]

WPS process definition.

version[source]
jobControlOptions[source]
outputTransmission[source]
processDescriptionURL[source]
class weaver.wps_restapi.swagger_definitions.ProcessSummaryList(*args, **kwargs)[source]

Combines DefaultSequenceSchema and DefaultSequenceSchema extensions so that default keyword is used first to resolve a missing sequence during deserialize() call, and then removes the node completely if no default was provided.

See also

  • ExtendedSchemaNode

  • ExtendedMappingSchema

processSummary[source]
class weaver.wps_restapi.swagger_definitions.ProcessCollection(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

processes[source]
class weaver.wps_restapi.swagger_definitions.ProcessInfo(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

executeEndpoint[source]
class weaver.wps_restapi.swagger_definitions.Process(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

inputs[source]
outputs[source]
visibility[source]
class weaver.wps_restapi.swagger_definitions.ProcessDeployment(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

inputs[source]
outputs[source]
visibility[source]
class weaver.wps_restapi.swagger_definitions.ProcessOutputDescriptionSchema(*args, **kwargs)[source]

WPS process output definition.

dataType[source]
defaultValue[source]
id[source]
abstract[source]
title[source]
class weaver.wps_restapi.swagger_definitions.JobStatusInfo(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

jobID[source]
status[source]
message[source]
created[source]
started[source]
finished[source]
duration[source]
runningSeconds[source]
expirationDate[source]
estimatedCompletion[source]
nextPoll[source]
percentCompleted[source]
class weaver.wps_restapi.swagger_definitions.JobEntrySchema(*args, **kwargs)[source]

Allows specifying multiple supported mapping schemas variants for an underlying schema definition. Corresponds to the oneOf specifier of OpenAPI specification.

Example:

class Variant1(MappingSchema):
    [...fields of Variant1...]

class Variant2(MappingSchema):
    [...fields of Variant2...]

class RequiredByBoth(MappingSchema):
    [...fields required by both Variant1 and Variant2...]

class OneOfWithRequiredFields(OneOfKeywordSchema, RequiredByBoth):
    _one_of = (Variant1, Variant2)
    [...alternatively, field required by all variants here...]

In the above example, the validation (ie: deserialize) process will succeed if only one of the _one_of variants’ validator completely succeed, and will fail if every variant fails validation execution. The operation will also fail if more than one validation succeeds.

Note

Class OneOfWithRequiredFields in the example is a shortcut variant to generate a specification that represents the pseudo-code oneOf([<list-of-objects-with-same-base>]).

The real OpenAPI method to implement the above very commonly occurring situation is as presented by the following pseudo-code:

oneOf[allOf[RequiredByBoth, Variant1], allOf[RequiredByBoth, Variant2]]

This is both painful to read and is a lot of extra code to write when you actually expand it all into classes (each oneOf/allOf is another class). Class OneOfKeywordSchema will actually simplify this by automatically making the allOf definitions for you if it detects other schema nodes than oneOf specified in the class bases. You can still do the full oneOf/allOf classes expansion manually though, it will result into the same specification.

Warning

When oneOf/allOf automatic expansion occurs during schema generation

Warning

When calling deserialize(), because the validation process requires exactly one of the variants to succeed to consider the whole object to evaluate as valid, it is important to insert more permissive validators later in the _one_of iterator (or validator keyword). For example, having a variant with all fields defined as optional (ie: with missing=drop) inserted as first item in _one_of will make it always succeed regardless of following variants (since an empty schema with everything dropped is valid for optional-only elements). This would have as side effect of potentially failing the validation if other object are also valid depending on the received schema because the schema cannot be discriminated between many. If this occurs, it means the your schemas are too permissive.

In the event that you have very similar schemas that can sometime match except one identifier (e.g.: field type defining the type of object), consider adding a validator to each sub-node with explicit values to solve the discrimination problem.

As a shortcut, the OpenAPI keyword discriminator can be provided to try matching as a last resort.

For example:

class Animal(ExtendedMappingSchema):
    name = ExtendedSchemaNode(String())
    type = ExtendedSchemaNode(String())  # with explicit definition, this shouldn't be here

    ## With explicit definitions, each below 'Animal' class should be defined as follows
    ## type = ExtendedSchemaNode(String(), validator=colander.OneOf(['<animal>']))

class Cat(Animal):
    [...]   # many **OPTIONAL** fields

class Dog(Animal):
    [...]   # many **OPTIONAL** fields

# With the discriminator keyword, following is possible
class SomeAnimal(OneOfMappingSchema):
    discriminator = {
        "propertyName": "type",     # correspond to 'type' of 'Animal'
        "mapping": {
            "cat": Cat, "dog": Dog  # map expected values to target schemas
        }
    }
    _one_of = [
        Cat(),
        Dog(),
    ]

Note

Keyword discriminator supports a map of key-string to schemas-type as presented in the example, and the key must be located at the top level of the mapping. If only discriminator = "<field>" is provided, the definition will be created automatically using the example (which should be only the matching value) of the corresponding field of each node within the _one_of mapping.

When multiple valid schemas are matched against the input data, the error will be raised and returned with corresponding erroneous elements for each sub-schema (fully listed).

See also

  • AllOfKeywordSchema

  • AnyOfKeywordSchema

  • NotKeywordSchema

_one_of[source]
class weaver.wps_restapi.swagger_definitions.JobCollection(*args, **kwargs)[source]

Combines DefaultSequenceSchema and DefaultSequenceSchema extensions so that default keyword is used first to resolve a missing sequence during deserialize() call, and then removes the node completely if no default was provided.

See also

  • ExtendedSchemaNode

  • ExtendedMappingSchema

item[source]
class weaver.wps_restapi.swagger_definitions.CreatedJobStatusSchema(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

status[source]
location[source]
jobID[source]
class weaver.wps_restapi.swagger_definitions.CreatedQuotedJobStatusSchema(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

bill[source]
class weaver.wps_restapi.swagger_definitions.GetPagingJobsSchema(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

jobs[source]
limit[source]
page[source]
class weaver.wps_restapi.swagger_definitions.JobCategoryFilters(*args, **kwargs)[source]

Object schema that will allow any unknown field to remain present in the resulting deserialization.

This type is useful for defining a dictionary where some field names are not known in advance, or when more optional keys that don’t need to all be exhaustively provided in the schema are acceptable.

When doing schema deserialization to validate it, unknown keys would normally be removed without this class (default behaviour is to ignore them). With this schema, content under an unknown key is preserved as it was received without any validation. Other fields that are explicitly specified with sub-schema nodes will still be validated as per usual behaviour.

Example:

class AnyKeyObject(PermissiveMappingSchema):
    known_key = SchemaNode(String())

AnyKeyObject().deserialize({"unknown": "kept", "known_key": "requirement"}))
# result: dictionary returned as is instead of removing 'unknown' entry
#         'known_key' is still validated with its string schema

Note

This class is only a shorthand definition of unknown keyword for convenience. All colander.MappingSchema support this natively.

category[source]
class weaver.wps_restapi.swagger_definitions.GroupedJobsCategorySchema(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

category[source]
jobs[source]
count[source]
class weaver.wps_restapi.swagger_definitions.GroupedCategoryJobsSchema(*args, **kwargs)[source]

Combines DefaultSequenceSchema and DefaultSequenceSchema extensions so that default keyword is used first to resolve a missing sequence during deserialize() call, and then removes the node completely if no default was provided.

See also

  • ExtendedSchemaNode

  • ExtendedMappingSchema

job_group_category_item[source]
class weaver.wps_restapi.swagger_definitions.GetGroupedJobsSchema(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

groups[source]
class weaver.wps_restapi.swagger_definitions.GetQueriedJobsSchema(*args, **kwargs)[source]

Allows specifying multiple supported mapping schemas variants for an underlying schema definition. Corresponds to the oneOf specifier of OpenAPI specification.

Example:

class Variant1(MappingSchema):
    [...fields of Variant1...]

class Variant2(MappingSchema):
    [...fields of Variant2...]

class RequiredByBoth(MappingSchema):
    [...fields required by both Variant1 and Variant2...]

class OneOfWithRequiredFields(OneOfKeywordSchema, RequiredByBoth):
    _one_of = (Variant1, Variant2)
    [...alternatively, field required by all variants here...]

In the above example, the validation (ie: deserialize) process will succeed if only one of the _one_of variants’ validator completely succeed, and will fail if every variant fails validation execution. The operation will also fail if more than one validation succeeds.

Note

Class OneOfWithRequiredFields in the example is a shortcut variant to generate a specification that represents the pseudo-code oneOf([<list-of-objects-with-same-base>]).

The real OpenAPI method to implement the above very commonly occurring situation is as presented by the following pseudo-code:

oneOf[allOf[RequiredByBoth, Variant1], allOf[RequiredByBoth, Variant2]]

This is both painful to read and is a lot of extra code to write when you actually expand it all into classes (each oneOf/allOf is another class). Class OneOfKeywordSchema will actually simplify this by automatically making the allOf definitions for you if it detects other schema nodes than oneOf specified in the class bases. You can still do the full oneOf/allOf classes expansion manually though, it will result into the same specification.

Warning

When oneOf/allOf automatic expansion occurs during schema generation

Warning

When calling deserialize(), because the validation process requires exactly one of the variants to succeed to consider the whole object to evaluate as valid, it is important to insert more permissive validators later in the _one_of iterator (or validator keyword). For example, having a variant with all fields defined as optional (ie: with missing=drop) inserted as first item in _one_of will make it always succeed regardless of following variants (since an empty schema with everything dropped is valid for optional-only elements). This would have as side effect of potentially failing the validation if other object are also valid depending on the received schema because the schema cannot be discriminated between many. If this occurs, it means the your schemas are too permissive.

In the event that you have very similar schemas that can sometime match except one identifier (e.g.: field type defining the type of object), consider adding a validator to each sub-node with explicit values to solve the discrimination problem.

As a shortcut, the OpenAPI keyword discriminator can be provided to try matching as a last resort.

For example:

class Animal(ExtendedMappingSchema):
    name = ExtendedSchemaNode(String())
    type = ExtendedSchemaNode(String())  # with explicit definition, this shouldn't be here

    ## With explicit definitions, each below 'Animal' class should be defined as follows
    ## type = ExtendedSchemaNode(String(), validator=colander.OneOf(['<animal>']))

class Cat(Animal):
    [...]   # many **OPTIONAL** fields

class Dog(Animal):
    [...]   # many **OPTIONAL** fields

# With the discriminator keyword, following is possible
class SomeAnimal(OneOfMappingSchema):
    discriminator = {
        "propertyName": "type",     # correspond to 'type' of 'Animal'
        "mapping": {
            "cat": Cat, "dog": Dog  # map expected values to target schemas
        }
    }
    _one_of = [
        Cat(),
        Dog(),
    ]

Note

Keyword discriminator supports a map of key-string to schemas-type as presented in the example, and the key must be located at the top level of the mapping. If only discriminator = "<field>" is provided, the definition will be created automatically using the example (which should be only the matching value) of the corresponding field of each node within the _one_of mapping.

When multiple valid schemas are matched against the input data, the error will be raised and returned with corresponding erroneous elements for each sub-schema (fully listed).

See also

  • AllOfKeywordSchema

  • AnyOfKeywordSchema

  • NotKeywordSchema

_one_of[source]
total[source]
class weaver.wps_restapi.swagger_definitions.DismissedJobSchema(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

status[source]
jobID[source]
message[source]
percentCompleted[source]
class weaver.wps_restapi.swagger_definitions.QuoteProcessParametersSchema(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

inputs[source]
outputs[source]
mode[source]
response[source]
class weaver.wps_restapi.swagger_definitions.AlternateQuotation(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

id[source]
title[source]
description[source]
price[source]
currency[source]
expire[source]
created[source]
details[source]
estimatedTime[source]
class weaver.wps_restapi.swagger_definitions.AlternateQuotationList(*args, **kwargs)[source]

Combines DefaultSequenceSchema and DefaultSequenceSchema extensions so that default keyword is used first to resolve a missing sequence during deserialize() call, and then removes the node completely if no default was provided.

See also

  • ExtendedSchemaNode

  • ExtendedMappingSchema

step[source]
class weaver.wps_restapi.swagger_definitions.DataEncodingAttributes(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

class weaver.wps_restapi.swagger_definitions.Reference(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

title = Reference[source]
href[source]
format[source]
body[source]
bodyReference[source]
class weaver.wps_restapi.swagger_definitions.AnyType(*args, **kwargs)[source]

Permissive variants that we attempt to parse automatically.

_one_of[source]
class weaver.wps_restapi.swagger_definitions.Input(*args, **kwargs)[source]

Default value to be looked for uses key ‘value’ to conform to OGC API standard. We still look for ‘href’, ‘data’ and ‘reference’ to remain back-compatible.

class weaver.wps_restapi.swagger_definitions.InputList(*args, **kwargs)[source]

Combines DefaultSequenceSchema and DefaultSequenceSchema extensions so that default keyword is used first to resolve a missing sequence during deserialize() call, and then removes the node completely if no default was provided.

See also

  • ExtendedSchemaNode

  • ExtendedMappingSchema

input[source]
class weaver.wps_restapi.swagger_definitions.Execute(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

inputs[source]
outputs[source]
mode[source]
notification_email[source]
response[source]
class weaver.wps_restapi.swagger_definitions.Quotation(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

id[source]
title[source]
description[source]
processId[source]
price[source]
currency[source]
expire[source]
created[source]
userId[source]
details[source]
estimatedTime[source]
processParameters[source]
alternativeQuotations[source]
class weaver.wps_restapi.swagger_definitions.QuoteProcessListSchema(*args, **kwargs)[source]

Combines DefaultSequenceSchema and DefaultSequenceSchema extensions so that default keyword is used first to resolve a missing sequence during deserialize() call, and then removes the node completely if no default was provided.

See also

  • ExtendedSchemaNode

  • ExtendedMappingSchema

step[source]
class weaver.wps_restapi.swagger_definitions.QuoteSchema(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

id[source]
process[source]
steps[source]
total[source]
class weaver.wps_restapi.swagger_definitions.QuotationList(*args, **kwargs)[source]

Combines DefaultSequenceSchema and DefaultSequenceSchema extensions so that default keyword is used first to resolve a missing sequence during deserialize() call, and then removes the node completely if no default was provided.

See also

  • ExtendedSchemaNode

  • ExtendedMappingSchema

quote[source]
class weaver.wps_restapi.swagger_definitions.QuotationListSchema(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

quotations[source]
class weaver.wps_restapi.swagger_definitions.BillSchema(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

id[source]
title[source]
description[source]
price[source]
currency[source]
created[source]
userId[source]
quotationId[source]
class weaver.wps_restapi.swagger_definitions.BillList(*args, **kwargs)[source]

Combines DefaultSequenceSchema and DefaultSequenceSchema extensions so that default keyword is used first to resolve a missing sequence during deserialize() call, and then removes the node completely if no default was provided.

See also

  • ExtendedSchemaNode

  • ExtendedMappingSchema

bill[source]
class weaver.wps_restapi.swagger_definitions.BillListSchema(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

bills[source]
class weaver.wps_restapi.swagger_definitions.SupportedValues(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

class weaver.wps_restapi.swagger_definitions.DefaultValues(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

class weaver.wps_restapi.swagger_definitions.CWLClass(*args, **kwargs)[source]

Combines all colander.SchemaNode extensions so that default keyword is used first to resolve a missing field value during deserialize() call, and then removes the node completely if no default was provided, and evaluate variables as needed.

See also

  • ExtendedMappingSchema

  • ExtendedSequenceSchema

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

name = class[source]
title = Class[source]
schema_type[source]
example = CommandLineTool[source]
validator[source]
description = CWL class specification. This is used to differentiate between single Application Package...[source]
class weaver.wps_restapi.swagger_definitions.RequirementClass(*args, **kwargs)[source]

Combines all colander.SchemaNode extensions so that default keyword is used first to resolve a missing field value during deserialize() call, and then removes the node completely if no default was provided, and evaluate variables as needed.

See also

  • ExtendedMappingSchema

  • ExtendedSequenceSchema

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

name = class[source]
title = RequirementClass[source]
schema_type[source]
description = CWL requirement class specification.[source]
class weaver.wps_restapi.swagger_definitions.DockerRequirementSpecification(*args, **kwargs)[source]

Object schema that will allow any unknown field to remain present in the resulting deserialization.

This type is useful for defining a dictionary where some field names are not known in advance, or when more optional keys that don’t need to all be exhaustively provided in the schema are acceptable.

When doing schema deserialization to validate it, unknown keys would normally be removed without this class (default behaviour is to ignore them). With this schema, content under an unknown key is preserved as it was received without any validation. Other fields that are explicitly specified with sub-schema nodes will still be validated as per usual behaviour.

Example:

class AnyKeyObject(PermissiveMappingSchema):
    known_key = SchemaNode(String())

AnyKeyObject().deserialize({"unknown": "kept", "known_key": "requirement"}))
# result: dictionary returned as is instead of removing 'unknown' entry
#         'known_key' is still validated with its string schema

Note

This class is only a shorthand definition of unknown keyword for convenience. All colander.MappingSchema support this natively.

dockerPull[source]
class weaver.wps_restapi.swagger_definitions.DockerRequirementMap(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

DockerRequirement[source]
class weaver.wps_restapi.swagger_definitions.DockerRequirementClass(*args, **kwargs)[source]

Object schema that will allow any unknown field to remain present in the resulting deserialization.

This type is useful for defining a dictionary where some field names are not known in advance, or when more optional keys that don’t need to all be exhaustively provided in the schema are acceptable.

When doing schema deserialization to validate it, unknown keys would normally be removed without this class (default behaviour is to ignore them). With this schema, content under an unknown key is preserved as it was received without any validation. Other fields that are explicitly specified with sub-schema nodes will still be validated as per usual behaviour.

Example:

class AnyKeyObject(PermissiveMappingSchema):
    known_key = SchemaNode(String())

AnyKeyObject().deserialize({"unknown": "kept", "known_key": "requirement"}))
# result: dictionary returned as is instead of removing 'unknown' entry
#         'known_key' is still validated with its string schema

Note

This class is only a shorthand definition of unknown keyword for convenience. All colander.MappingSchema support this natively.

_class[source]
class weaver.wps_restapi.swagger_definitions.DockerGpuRequirementSpecification(*args, **kwargs)[source]

Object schema that will allow any unknown field to remain present in the resulting deserialization.

This type is useful for defining a dictionary where some field names are not known in advance, or when more optional keys that don’t need to all be exhaustively provided in the schema are acceptable.

When doing schema deserialization to validate it, unknown keys would normally be removed without this class (default behaviour is to ignore them). With this schema, content under an unknown key is preserved as it was received without any validation. Other fields that are explicitly specified with sub-schema nodes will still be validated as per usual behaviour.

Example:

class AnyKeyObject(PermissiveMappingSchema):
    known_key = SchemaNode(String())

AnyKeyObject().deserialize({"unknown": "kept", "known_key": "requirement"}))
# result: dictionary returned as is instead of removing 'unknown' entry
#         'known_key' is still validated with its string schema

Note

This class is only a shorthand definition of unknown keyword for convenience. All colander.MappingSchema support this natively.

description = Docker requirement with GPU-enabled support (https://github.com/NVIDIA/nvidia-docker). The...[source]
class weaver.wps_restapi.swagger_definitions.DockerGpuRequirementMap(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

req[source]
class weaver.wps_restapi.swagger_definitions.DockerGpuRequirementClass(*args, **kwargs)[source]

Object schema that will allow any unknown field to remain present in the resulting deserialization.

This type is useful for defining a dictionary where some field names are not known in advance, or when more optional keys that don’t need to all be exhaustively provided in the schema are acceptable.

When doing schema deserialization to validate it, unknown keys would normally be removed without this class (default behaviour is to ignore them). With this schema, content under an unknown key is preserved as it was received without any validation. Other fields that are explicitly specified with sub-schema nodes will still be validated as per usual behaviour.

Example:

class AnyKeyObject(PermissiveMappingSchema):
    known_key = SchemaNode(String())

AnyKeyObject().deserialize({"unknown": "kept", "known_key": "requirement"}))
# result: dictionary returned as is instead of removing 'unknown' entry
#         'known_key' is still validated with its string schema

Note

This class is only a shorthand definition of unknown keyword for convenience. All colander.MappingSchema support this natively.

title[source]
_class[source]
class weaver.wps_restapi.swagger_definitions.DirectoryListing(*args, **kwargs)[source]

Object schema that will allow any unknown field to remain present in the resulting deserialization.

This type is useful for defining a dictionary where some field names are not known in advance, or when more optional keys that don’t need to all be exhaustively provided in the schema are acceptable.

When doing schema deserialization to validate it, unknown keys would normally be removed without this class (default behaviour is to ignore them). With this schema, content under an unknown key is preserved as it was received without any validation. Other fields that are explicitly specified with sub-schema nodes will still be validated as per usual behaviour.

Example:

class AnyKeyObject(PermissiveMappingSchema):
    known_key = SchemaNode(String())

AnyKeyObject().deserialize({"unknown": "kept", "known_key": "requirement"}))
# result: dictionary returned as is instead of removing 'unknown' entry
#         'known_key' is still validated with its string schema

Note

This class is only a shorthand definition of unknown keyword for convenience. All colander.MappingSchema support this natively.

entry[source]
class weaver.wps_restapi.swagger_definitions.InitialWorkDirListing(*args, **kwargs)[source]

Combines DefaultSequenceSchema and DefaultSequenceSchema extensions so that default keyword is used first to resolve a missing sequence during deserialize() call, and then removes the node completely if no default was provided.

See also

  • ExtendedSchemaNode

  • ExtendedMappingSchema

listing[source]
class weaver.wps_restapi.swagger_definitions.InitialWorkDirRequirementSpecification(*args, **kwargs)[source]

Object schema that will allow any unknown field to remain present in the resulting deserialization.

This type is useful for defining a dictionary where some field names are not known in advance, or when more optional keys that don’t need to all be exhaustively provided in the schema are acceptable.

When doing schema deserialization to validate it, unknown keys would normally be removed without this class (default behaviour is to ignore them). With this schema, content under an unknown key is preserved as it was received without any validation. Other fields that are explicitly specified with sub-schema nodes will still be validated as per usual behaviour.

Example:

class AnyKeyObject(PermissiveMappingSchema):
    known_key = SchemaNode(String())

AnyKeyObject().deserialize({"unknown": "kept", "known_key": "requirement"}))
# result: dictionary returned as is instead of removing 'unknown' entry
#         'known_key' is still validated with its string schema

Note

This class is only a shorthand definition of unknown keyword for convenience. All colander.MappingSchema support this natively.

listing[source]
class weaver.wps_restapi.swagger_definitions.InitialWorkDirRequirementMap(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

req[source]
class weaver.wps_restapi.swagger_definitions.InitialWorkDirRequirementClass(*args, **kwargs)[source]

Object schema that will allow any unknown field to remain present in the resulting deserialization.

This type is useful for defining a dictionary where some field names are not known in advance, or when more optional keys that don’t need to all be exhaustively provided in the schema are acceptable.

When doing schema deserialization to validate it, unknown keys would normally be removed without this class (default behaviour is to ignore them). With this schema, content under an unknown key is preserved as it was received without any validation. Other fields that are explicitly specified with sub-schema nodes will still be validated as per usual behaviour.

Example:

class AnyKeyObject(PermissiveMappingSchema):
    known_key = SchemaNode(String())

AnyKeyObject().deserialize({"unknown": "kept", "known_key": "requirement"}))
# result: dictionary returned as is instead of removing 'unknown' entry
#         'known_key' is still validated with its string schema

Note

This class is only a shorthand definition of unknown keyword for convenience. All colander.MappingSchema support this natively.

_class[source]
class weaver.wps_restapi.swagger_definitions.BuiltinRequirementSpecification(*args, **kwargs)[source]

Object schema that will allow any unknown field to remain present in the resulting deserialization.

This type is useful for defining a dictionary where some field names are not known in advance, or when more optional keys that don’t need to all be exhaustively provided in the schema are acceptable.

When doing schema deserialization to validate it, unknown keys would normally be removed without this class (default behaviour is to ignore them). With this schema, content under an unknown key is preserved as it was received without any validation. Other fields that are explicitly specified with sub-schema nodes will still be validated as per usual behaviour.

Example:

class AnyKeyObject(PermissiveMappingSchema):
    known_key = SchemaNode(String())

AnyKeyObject().deserialize({"unknown": "kept", "known_key": "requirement"}))
# result: dictionary returned as is instead of removing 'unknown' entry
#         'known_key' is still validated with its string schema

Note

This class is only a shorthand definition of unknown keyword for convenience. All colander.MappingSchema support this natively.

title[source]
description = Hint indicating that the Application Package corresponds to a builtin process of this instance....[source]
process[source]
class weaver.wps_restapi.swagger_definitions.BuiltinRequirementMap(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

req[source]
class weaver.wps_restapi.swagger_definitions.BuiltinRequirementClass(*args, **kwargs)[source]

Object schema that will allow any unknown field to remain present in the resulting deserialization.

This type is useful for defining a dictionary where some field names are not known in advance, or when more optional keys that don’t need to all be exhaustively provided in the schema are acceptable.

When doing schema deserialization to validate it, unknown keys would normally be removed without this class (default behaviour is to ignore them). With this schema, content under an unknown key is preserved as it was received without any validation. Other fields that are explicitly specified with sub-schema nodes will still be validated as per usual behaviour.

Example:

class AnyKeyObject(PermissiveMappingSchema):
    known_key = SchemaNode(String())

AnyKeyObject().deserialize({"unknown": "kept", "known_key": "requirement"}))
# result: dictionary returned as is instead of removing 'unknown' entry
#         'known_key' is still validated with its string schema

Note

This class is only a shorthand definition of unknown keyword for convenience. All colander.MappingSchema support this natively.

_class[source]
class weaver.wps_restapi.swagger_definitions.ESGF_CWT_RequirementSpecification(*args, **kwargs)[source]

Object schema that will allow any unknown field to remain present in the resulting deserialization.

This type is useful for defining a dictionary where some field names are not known in advance, or when more optional keys that don’t need to all be exhaustively provided in the schema are acceptable.

When doing schema deserialization to validate it, unknown keys would normally be removed without this class (default behaviour is to ignore them). With this schema, content under an unknown key is preserved as it was received without any validation. Other fields that are explicitly specified with sub-schema nodes will still be validated as per usual behaviour.

Example:

class AnyKeyObject(PermissiveMappingSchema):
    known_key = SchemaNode(String())

AnyKeyObject().deserialize({"unknown": "kept", "known_key": "requirement"}))
# result: dictionary returned as is instead of removing 'unknown' entry
#         'known_key' is still validated with its string schema

Note

This class is only a shorthand definition of unknown keyword for convenience. All colander.MappingSchema support this natively.

title[source]
description = Hint indicating that the Application Package corresponds to an ESGF-CWT provider processthat...[source]
process[source]
provider[source]
class weaver.wps_restapi.swagger_definitions.ESGF_CWT_RequirementMap(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

req[source]
class weaver.wps_restapi.swagger_definitions.ESGF_CWT_RequirementClass(*args, **kwargs)[source]

Object schema that will allow any unknown field to remain present in the resulting deserialization.

This type is useful for defining a dictionary where some field names are not known in advance, or when more optional keys that don’t need to all be exhaustively provided in the schema are acceptable.

When doing schema deserialization to validate it, unknown keys would normally be removed without this class (default behaviour is to ignore them). With this schema, content under an unknown key is preserved as it was received without any validation. Other fields that are explicitly specified with sub-schema nodes will still be validated as per usual behaviour.

Example:

class AnyKeyObject(PermissiveMappingSchema):
    known_key = SchemaNode(String())

AnyKeyObject().deserialize({"unknown": "kept", "known_key": "requirement"}))
# result: dictionary returned as is instead of removing 'unknown' entry
#         'known_key' is still validated with its string schema

Note

This class is only a shorthand definition of unknown keyword for convenience. All colander.MappingSchema support this natively.

_class[source]
class weaver.wps_restapi.swagger_definitions.WPS1RequirementSpecification(*args, **kwargs)[source]

Object schema that will allow any unknown field to remain present in the resulting deserialization.

This type is useful for defining a dictionary where some field names are not known in advance, or when more optional keys that don’t need to all be exhaustively provided in the schema are acceptable.

When doing schema deserialization to validate it, unknown keys would normally be removed without this class (default behaviour is to ignore them). With this schema, content under an unknown key is preserved as it was received without any validation. Other fields that are explicitly specified with sub-schema nodes will still be validated as per usual behaviour.

Example:

class AnyKeyObject(PermissiveMappingSchema):
    known_key = SchemaNode(String())

AnyKeyObject().deserialize({"unknown": "kept", "known_key": "requirement"}))
# result: dictionary returned as is instead of removing 'unknown' entry
#         'known_key' is still validated with its string schema

Note

This class is only a shorthand definition of unknown keyword for convenience. All colander.MappingSchema support this natively.

title[source]
description = Hint indicating that the Application Package corresponds to a WPS-1 provider processthat should...[source]
process[source]
provider[source]
class weaver.wps_restapi.swagger_definitions.WPS1RequirementMap(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

req[source]
class weaver.wps_restapi.swagger_definitions.WPS1RequirementClass(*args, **kwargs)[source]

Object schema that will allow any unknown field to remain present in the resulting deserialization.

This type is useful for defining a dictionary where some field names are not known in advance, or when more optional keys that don’t need to all be exhaustively provided in the schema are acceptable.

When doing schema deserialization to validate it, unknown keys would normally be removed without this class (default behaviour is to ignore them). With this schema, content under an unknown key is preserved as it was received without any validation. Other fields that are explicitly specified with sub-schema nodes will still be validated as per usual behaviour.

Example:

class AnyKeyObject(PermissiveMappingSchema):
    known_key = SchemaNode(String())

AnyKeyObject().deserialize({"unknown": "kept", "known_key": "requirement"}))
# result: dictionary returned as is instead of removing 'unknown' entry
#         'known_key' is still validated with its string schema

Note

This class is only a shorthand definition of unknown keyword for convenience. All colander.MappingSchema support this natively.

_class[source]
class weaver.wps_restapi.swagger_definitions.UnknownRequirementClass(*args, **kwargs)[source]

Object schema that will allow any unknown field to remain present in the resulting deserialization.

This type is useful for defining a dictionary where some field names are not known in advance, or when more optional keys that don’t need to all be exhaustively provided in the schema are acceptable.

When doing schema deserialization to validate it, unknown keys would normally be removed without this class (default behaviour is to ignore them). With this schema, content under an unknown key is preserved as it was received without any validation. Other fields that are explicitly specified with sub-schema nodes will still be validated as per usual behaviour.

Example:

class AnyKeyObject(PermissiveMappingSchema):
    known_key = SchemaNode(String())

AnyKeyObject().deserialize({"unknown": "kept", "known_key": "requirement"}))
# result: dictionary returned as is instead of removing 'unknown' entry
#         'known_key' is still validated with its string schema

Note

This class is only a shorthand definition of unknown keyword for convenience. All colander.MappingSchema support this natively.

_class[source]
class weaver.wps_restapi.swagger_definitions.CWLRequirementsMap(*args, **kwargs)[source]

Allows specifying all mapping schemas that can be matched for an underlying schema definition. Corresponds to the anyOf specifier of OpenAPI specification.

Contrary to OneOfKeywordSchema that MUST be validated with exactly one schema, this definition will continue parsing all possibilities and apply validated sub-schemas on top of each other. Not all schemas have to be valid like in the case of AllOfKeywordSchema to succeed, as long as at least one of them is valid.

Example:

class RequiredItem(ExtendedMappingSchema):
    item = ExtendedSchemaNode(String())

class RequiredType(ExtendedMappingSchema):
    type = ExtendedSchemaNode(String())

class RequiredFields(ExtendedMappingSchema):
    field_str = ExtendedSchemaNode(String())
    field_int = ExtendedSchemaNode(Integer())

class AnyRequired(AnyKeywordSchema):
    _any_of = [RequiredItem(), RequiredType(), RequiredFields()]

# following is valid because their individual parts have all required sub-fields, result is their composition
AnyRequired().deserialize({"type": "test", "item": "valid"})     # result: {"type": "test", "item": "valid"}

# following is also valid because even though 'item' is missing, the 'type' is present
AnyRequired().deserialize({"type": "test"})                      # result: {"type": "test"}

# following is invalid because every one of the sub-field of individual parts are missing
AnyRequired().deserialize({"type": "test"})

# following is invalid because fields of 'RequiredFields' are only partially fulfilled
AnyRequired().deserialize({"field_str": "str"})

# following is valid because although fields of 'RequiredFields' are not all fulfilled, 'RequiredType' is valid
AnyRequired().deserialize({"field_str": "str", "type": "str"})  # result: {"type": "test"}

# following is invalid because 'RequiredFields' field 'field_int' is incorrect schema type
AnyRequired().deserialize({"field_str": "str", "field_int": "str"})

# following is valid, but result omits 'type' because its schema-type is incorrect, while others are valid
AnyRequired().deserialize({"field_str": "str", "field_int": 1, "items": "fields", "type": 1})
# result: {"field_str": "str", "field_int": 1, "items": "fields"}

Warning

Because valid items are applied on top of each other by merging fields during combinations, conflicting field names of any valid schema will contain only the final valid parsing during deserialization.

See also

  • OneOfKeywordSchema

  • AllOfKeywordSchema

  • NotKeywordSchema

_any_of[source]
class weaver.wps_restapi.swagger_definitions.CWLRequirementsItem(*args, **kwargs)[source]

Allows specifying multiple supported mapping schemas variants for an underlying schema definition. Corresponds to the oneOf specifier of OpenAPI specification.

Example:

class Variant1(MappingSchema):
    [...fields of Variant1...]

class Variant2(MappingSchema):
    [...fields of Variant2...]

class RequiredByBoth(MappingSchema):
    [...fields required by both Variant1 and Variant2...]

class OneOfWithRequiredFields(OneOfKeywordSchema, RequiredByBoth):
    _one_of = (Variant1, Variant2)
    [...alternatively, field required by all variants here...]

In the above example, the validation (ie: deserialize) process will succeed if only one of the _one_of variants’ validator completely succeed, and will fail if every variant fails validation execution. The operation will also fail if more than one validation succeeds.

Note

Class OneOfWithRequiredFields in the example is a shortcut variant to generate a specification that represents the pseudo-code oneOf([<list-of-objects-with-same-base>]).

The real OpenAPI method to implement the above very commonly occurring situation is as presented by the following pseudo-code:

oneOf[allOf[RequiredByBoth, Variant1], allOf[RequiredByBoth, Variant2]]

This is both painful to read and is a lot of extra code to write when you actually expand it all into classes (each oneOf/allOf is another class). Class OneOfKeywordSchema will actually simplify this by automatically making the allOf definitions for you if it detects other schema nodes than oneOf specified in the class bases. You can still do the full oneOf/allOf classes expansion manually though, it will result into the same specification.

Warning

When oneOf/allOf automatic expansion occurs during schema generation

Warning

When calling deserialize(), because the validation process requires exactly one of the variants to succeed to consider the whole object to evaluate as valid, it is important to insert more permissive validators later in the _one_of iterator (or validator keyword). For example, having a variant with all fields defined as optional (ie: with missing=drop) inserted as first item in _one_of will make it always succeed regardless of following variants (since an empty schema with everything dropped is valid for optional-only elements). This would have as side effect of potentially failing the validation if other object are also valid depending on the received schema because the schema cannot be discriminated between many. If this occurs, it means the your schemas are too permissive.

In the event that you have very similar schemas that can sometime match except one identifier (e.g.: field type defining the type of object), consider adding a validator to each sub-node with explicit values to solve the discrimination problem.

As a shortcut, the OpenAPI keyword discriminator can be provided to try matching as a last resort.

For example:

class Animal(ExtendedMappingSchema):
    name = ExtendedSchemaNode(String())
    type = ExtendedSchemaNode(String())  # with explicit definition, this shouldn't be here

    ## With explicit definitions, each below 'Animal' class should be defined as follows
    ## type = ExtendedSchemaNode(String(), validator=colander.OneOf(['<animal>']))

class Cat(Animal):
    [...]   # many **OPTIONAL** fields

class Dog(Animal):
    [...]   # many **OPTIONAL** fields

# With the discriminator keyword, following is possible
class SomeAnimal(OneOfMappingSchema):
    discriminator = {
        "propertyName": "type",     # correspond to 'type' of 'Animal'
        "mapping": {
            "cat": Cat, "dog": Dog  # map expected values to target schemas
        }
    }
    _one_of = [
        Cat(),
        Dog(),
    ]

Note

Keyword discriminator supports a map of key-string to schemas-type as presented in the example, and the key must be located at the top level of the mapping. If only discriminator = "<field>" is provided, the definition will be created automatically using the example (which should be only the matching value) of the corresponding field of each node within the _one_of mapping.

When multiple valid schemas are matched against the input data, the error will be raised and returned with corresponding erroneous elements for each sub-schema (fully listed).

See also

  • AllOfKeywordSchema

  • AnyOfKeywordSchema

  • NotKeywordSchema

_one_of[source]
class weaver.wps_restapi.swagger_definitions.CWLRequirementsList(*args, **kwargs)[source]

Combines DefaultSequenceSchema and DefaultSequenceSchema extensions so that default keyword is used first to resolve a missing sequence during deserialize() call, and then removes the node completely if no default was provided.

See also

  • ExtendedSchemaNode

  • ExtendedMappingSchema

requirement[source]
class weaver.wps_restapi.swagger_definitions.CWLRequirements(*args, **kwargs)[source]

Allows specifying multiple supported mapping schemas variants for an underlying schema definition. Corresponds to the oneOf specifier of OpenAPI specification.

Example:

class Variant1(MappingSchema):
    [...fields of Variant1...]

class Variant2(MappingSchema):
    [...fields of Variant2...]

class RequiredByBoth(MappingSchema):
    [...fields required by both Variant1 and Variant2...]

class OneOfWithRequiredFields(OneOfKeywordSchema, RequiredByBoth):
    _one_of = (Variant1, Variant2)
    [...alternatively, field required by all variants here...]

In the above example, the validation (ie: deserialize) process will succeed if only one of the _one_of variants’ validator completely succeed, and will fail if every variant fails validation execution. The operation will also fail if more than one validation succeeds.

Note

Class OneOfWithRequiredFields in the example is a shortcut variant to generate a specification that represents the pseudo-code oneOf([<list-of-objects-with-same-base>]).

The real OpenAPI method to implement the above very commonly occurring situation is as presented by the following pseudo-code:

oneOf[allOf[RequiredByBoth, Variant1], allOf[RequiredByBoth, Variant2]]

This is both painful to read and is a lot of extra code to write when you actually expand it all into classes (each oneOf/allOf is another class). Class OneOfKeywordSchema will actually simplify this by automatically making the allOf definitions for you if it detects other schema nodes than oneOf specified in the class bases. You can still do the full oneOf/allOf classes expansion manually though, it will result into the same specification.

Warning

When oneOf/allOf automatic expansion occurs during schema generation

Warning

When calling deserialize(), because the validation process requires exactly one of the variants to succeed to consider the whole object to evaluate as valid, it is important to insert more permissive validators later in the _one_of iterator (or validator keyword). For example, having a variant with all fields defined as optional (ie: with missing=drop) inserted as first item in _one_of will make it always succeed regardless of following variants (since an empty schema with everything dropped is valid for optional-only elements). This would have as side effect of potentially failing the validation if other object are also valid depending on the received schema because the schema cannot be discriminated between many. If this occurs, it means the your schemas are too permissive.

In the event that you have very similar schemas that can sometime match except one identifier (e.g.: field type defining the type of object), consider adding a validator to each sub-node with explicit values to solve the discrimination problem.

As a shortcut, the OpenAPI keyword discriminator can be provided to try matching as a last resort.

For example:

class Animal(ExtendedMappingSchema):
    name = ExtendedSchemaNode(String())
    type = ExtendedSchemaNode(String())  # with explicit definition, this shouldn't be here

    ## With explicit definitions, each below 'Animal' class should be defined as follows
    ## type = ExtendedSchemaNode(String(), validator=colander.OneOf(['<animal>']))

class Cat(Animal):
    [...]   # many **OPTIONAL** fields

class Dog(Animal):
    [...]   # many **OPTIONAL** fields

# With the discriminator keyword, following is possible
class SomeAnimal(OneOfMappingSchema):
    discriminator = {
        "propertyName": "type",     # correspond to 'type' of 'Animal'
        "mapping": {
            "cat": Cat, "dog": Dog  # map expected values to target schemas
        }
    }
    _one_of = [
        Cat(),
        Dog(),
    ]

Note

Keyword discriminator supports a map of key-string to schemas-type as presented in the example, and the key must be located at the top level of the mapping. If only discriminator = "<field>" is provided, the definition will be created automatically using the example (which should be only the matching value) of the corresponding field of each node within the _one_of mapping.

When multiple valid schemas are matched against the input data, the error will be raised and returned with corresponding erroneous elements for each sub-schema (fully listed).

See also

  • AllOfKeywordSchema

  • AnyOfKeywordSchema

  • NotKeywordSchema

_one_of[source]
class weaver.wps_restapi.swagger_definitions.CWLHintsMap(*args, **kwargs)[source]

Allows specifying all mapping schemas that can be matched for an underlying schema definition. Corresponds to the anyOf specifier of OpenAPI specification.

Contrary to OneOfKeywordSchema that MUST be validated with exactly one schema, this definition will continue parsing all possibilities and apply validated sub-schemas on top of each other. Not all schemas have to be valid like in the case of AllOfKeywordSchema to succeed, as long as at least one of them is valid.

Example:

class RequiredItem(ExtendedMappingSchema):
    item = ExtendedSchemaNode(String())

class RequiredType(ExtendedMappingSchema):
    type = ExtendedSchemaNode(String())

class RequiredFields(ExtendedMappingSchema):
    field_str = ExtendedSchemaNode(String())
    field_int = ExtendedSchemaNode(Integer())

class AnyRequired(AnyKeywordSchema):
    _any_of = [RequiredItem(), RequiredType(), RequiredFields()]

# following is valid because their individual parts have all required sub-fields, result is their composition
AnyRequired().deserialize({"type": "test", "item": "valid"})     # result: {"type": "test", "item": "valid"}

# following is also valid because even though 'item' is missing, the 'type' is present
AnyRequired().deserialize({"type": "test"})                      # result: {"type": "test"}

# following is invalid because every one of the sub-field of individual parts are missing
AnyRequired().deserialize({"type": "test"})

# following is invalid because fields of 'RequiredFields' are only partially fulfilled
AnyRequired().deserialize({"field_str": "str"})

# following is valid because although fields of 'RequiredFields' are not all fulfilled, 'RequiredType' is valid
AnyRequired().deserialize({"field_str": "str", "type": "str"})  # result: {"type": "test"}

# following is invalid because 'RequiredFields' field 'field_int' is incorrect schema type
AnyRequired().deserialize({"field_str": "str", "field_int": "str"})

# following is valid, but result omits 'type' because its schema-type is incorrect, while others are valid
AnyRequired().deserialize({"field_str": "str", "field_int": 1, "items": "fields", "type": 1})
# result: {"field_str": "str", "field_int": 1, "items": "fields"}

Warning

Because valid items are applied on top of each other by merging fields during combinations, conflicting field names of any valid schema will contain only the final valid parsing during deserialization.

See also

  • OneOfKeywordSchema

  • AllOfKeywordSchema

  • NotKeywordSchema

_any_of[source]
class weaver.wps_restapi.swagger_definitions.CWLHintsItem(*args, **kwargs)[source]

Allows specifying multiple supported mapping schemas variants for an underlying schema definition. Corresponds to the oneOf specifier of OpenAPI specification.

Example:

class Variant1(MappingSchema):
    [...fields of Variant1...]

class Variant2(MappingSchema):
    [...fields of Variant2...]

class RequiredByBoth(MappingSchema):
    [...fields required by both Variant1 and Variant2...]

class OneOfWithRequiredFields(OneOfKeywordSchema, RequiredByBoth):
    _one_of = (Variant1, Variant2)
    [...alternatively, field required by all variants here...]

In the above example, the validation (ie: deserialize) process will succeed if only one of the _one_of variants’ validator completely succeed, and will fail if every variant fails validation execution. The operation will also fail if more than one validation succeeds.

Note

Class OneOfWithRequiredFields in the example is a shortcut variant to generate a specification that represents the pseudo-code oneOf([<list-of-objects-with-same-base>]).

The real OpenAPI method to implement the above very commonly occurring situation is as presented by the following pseudo-code:

oneOf[allOf[RequiredByBoth, Variant1], allOf[RequiredByBoth, Variant2]]

This is both painful to read and is a lot of extra code to write when you actually expand it all into classes (each oneOf/allOf is another class). Class OneOfKeywordSchema will actually simplify this by automatically making the allOf definitions for you if it detects other schema nodes than oneOf specified in the class bases. You can still do the full oneOf/allOf classes expansion manually though, it will result into the same specification.

Warning

When oneOf/allOf automatic expansion occurs during schema generation

Warning

When calling deserialize(), because the validation process requires exactly one of the variants to succeed to consider the whole object to evaluate as valid, it is important to insert more permissive validators later in the _one_of iterator (or validator keyword). For example, having a variant with all fields defined as optional (ie: with missing=drop) inserted as first item in _one_of will make it always succeed regardless of following variants (since an empty schema with everything dropped is valid for optional-only elements). This would have as side effect of potentially failing the validation if other object are also valid depending on the received schema because the schema cannot be discriminated between many. If this occurs, it means the your schemas are too permissive.

In the event that you have very similar schemas that can sometime match except one identifier (e.g.: field type defining the type of object), consider adding a validator to each sub-node with explicit values to solve the discrimination problem.

As a shortcut, the OpenAPI keyword discriminator can be provided to try matching as a last resort.

For example:

class Animal(ExtendedMappingSchema):
    name = ExtendedSchemaNode(String())
    type = ExtendedSchemaNode(String())  # with explicit definition, this shouldn't be here

    ## With explicit definitions, each below 'Animal' class should be defined as follows
    ## type = ExtendedSchemaNode(String(), validator=colander.OneOf(['<animal>']))

class Cat(Animal):
    [...]   # many **OPTIONAL** fields

class Dog(Animal):
    [...]   # many **OPTIONAL** fields

# With the discriminator keyword, following is possible
class SomeAnimal(OneOfMappingSchema):
    discriminator = {
        "propertyName": "type",     # correspond to 'type' of 'Animal'
        "mapping": {
            "cat": Cat, "dog": Dog  # map expected values to target schemas
        }
    }
    _one_of = [
        Cat(),
        Dog(),
    ]

Note

Keyword discriminator supports a map of key-string to schemas-type as presented in the example, and the key must be located at the top level of the mapping. If only discriminator = "<field>" is provided, the definition will be created automatically using the example (which should be only the matching value) of the corresponding field of each node within the _one_of mapping.

When multiple valid schemas are matched against the input data, the error will be raised and returned with corresponding erroneous elements for each sub-schema (fully listed).

See also

  • AllOfKeywordSchema

  • AnyOfKeywordSchema

  • NotKeywordSchema

discriminator = class[source]
_one_of[source]
class weaver.wps_restapi.swagger_definitions.CWLHintsList(*args, **kwargs)[source]

Combines DefaultSequenceSchema and DefaultSequenceSchema extensions so that default keyword is used first to resolve a missing sequence during deserialize() call, and then removes the node completely if no default was provided.

See also

  • ExtendedSchemaNode

  • ExtendedMappingSchema

hint[source]
class weaver.wps_restapi.swagger_definitions.CWLHints(*args, **kwargs)[source]

Allows specifying multiple supported mapping schemas variants for an underlying schema definition. Corresponds to the oneOf specifier of OpenAPI specification.

Example:

class Variant1(MappingSchema):
    [...fields of Variant1...]

class Variant2(MappingSchema):
    [...fields of Variant2...]

class RequiredByBoth(MappingSchema):
    [...fields required by both Variant1 and Variant2...]

class OneOfWithRequiredFields(OneOfKeywordSchema, RequiredByBoth):
    _one_of = (Variant1, Variant2)
    [...alternatively, field required by all variants here...]

In the above example, the validation (ie: deserialize) process will succeed if only one of the _one_of variants’ validator completely succeed, and will fail if every variant fails validation execution. The operation will also fail if more than one validation succeeds.

Note

Class OneOfWithRequiredFields in the example is a shortcut variant to generate a specification that represents the pseudo-code oneOf([<list-of-objects-with-same-base>]).

The real OpenAPI method to implement the above very commonly occurring situation is as presented by the following pseudo-code:

oneOf[allOf[RequiredByBoth, Variant1], allOf[RequiredByBoth, Variant2]]

This is both painful to read and is a lot of extra code to write when you actually expand it all into classes (each oneOf/allOf is another class). Class OneOfKeywordSchema will actually simplify this by automatically making the allOf definitions for you if it detects other schema nodes than oneOf specified in the class bases. You can still do the full oneOf/allOf classes expansion manually though, it will result into the same specification.

Warning

When oneOf/allOf automatic expansion occurs during schema generation

Warning

When calling deserialize(), because the validation process requires exactly one of the variants to succeed to consider the whole object to evaluate as valid, it is important to insert more permissive validators later in the _one_of iterator (or validator keyword). For example, having a variant with all fields defined as optional (ie: with missing=drop) inserted as first item in _one_of will make it always succeed regardless of following variants (since an empty schema with everything dropped is valid for optional-only elements). This would have as side effect of potentially failing the validation if other object are also valid depending on the received schema because the schema cannot be discriminated between many. If this occurs, it means the your schemas are too permissive.

In the event that you have very similar schemas that can sometime match except one identifier (e.g.: field type defining the type of object), consider adding a validator to each sub-node with explicit values to solve the discrimination problem.

As a shortcut, the OpenAPI keyword discriminator can be provided to try matching as a last resort.

For example:

class Animal(ExtendedMappingSchema):
    name = ExtendedSchemaNode(String())
    type = ExtendedSchemaNode(String())  # with explicit definition, this shouldn't be here

    ## With explicit definitions, each below 'Animal' class should be defined as follows
    ## type = ExtendedSchemaNode(String(), validator=colander.OneOf(['<animal>']))

class Cat(Animal):
    [...]   # many **OPTIONAL** fields

class Dog(Animal):
    [...]   # many **OPTIONAL** fields

# With the discriminator keyword, following is possible
class SomeAnimal(OneOfMappingSchema):
    discriminator = {
        "propertyName": "type",     # correspond to 'type' of 'Animal'
        "mapping": {
            "cat": Cat, "dog": Dog  # map expected values to target schemas
        }
    }
    _one_of = [
        Cat(),
        Dog(),
    ]

Note

Keyword discriminator supports a map of key-string to schemas-type as presented in the example, and the key must be located at the top level of the mapping. If only discriminator = "<field>" is provided, the definition will be created automatically using the example (which should be only the matching value) of the corresponding field of each node within the _one_of mapping.

When multiple valid schemas are matched against the input data, the error will be raised and returned with corresponding erroneous elements for each sub-schema (fully listed).

See also

  • AllOfKeywordSchema

  • AnyOfKeywordSchema

  • NotKeywordSchema

_one_of[source]
class weaver.wps_restapi.swagger_definitions.CWLArguments(*args, **kwargs)[source]

Combines DefaultSequenceSchema and DefaultSequenceSchema extensions so that default keyword is used first to resolve a missing sequence during deserialize() call, and then removes the node completely if no default was provided.

See also

  • ExtendedSchemaNode

  • ExtendedMappingSchema

argument[source]
class weaver.wps_restapi.swagger_definitions.CWLTypeString(*args, **kwargs)[source]

Combines all colander.SchemaNode extensions so that default keyword is used first to resolve a missing field value during deserialize() call, and then removes the node completely if no default was provided, and evaluate variables as needed.

See also

  • ExtendedMappingSchema

  • ExtendedSequenceSchema

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

schema_type[source]
title = Type[source]
description = Field type definition.[source]
example = float[source]
validator[source]
class weaver.wps_restapi.swagger_definitions.CWLTypeSymbolValues(*args, **kwargs)[source]

Allows specifying multiple supported mapping schemas variants for an underlying schema definition. Corresponds to the oneOf specifier of OpenAPI specification.

Example:

class Variant1(MappingSchema):
    [...fields of Variant1...]

class Variant2(MappingSchema):
    [...fields of Variant2...]

class RequiredByBoth(MappingSchema):
    [...fields required by both Variant1 and Variant2...]

class OneOfWithRequiredFields(OneOfKeywordSchema, RequiredByBoth):
    _one_of = (Variant1, Variant2)
    [...alternatively, field required by all variants here...]

In the above example, the validation (ie: deserialize) process will succeed if only one of the _one_of variants’ validator completely succeed, and will fail if every variant fails validation execution. The operation will also fail if more than one validation succeeds.

Note

Class OneOfWithRequiredFields in the example is a shortcut variant to generate a specification that represents the pseudo-code oneOf([<list-of-objects-with-same-base>]).

The real OpenAPI method to implement the above very commonly occurring situation is as presented by the following pseudo-code:

oneOf[allOf[RequiredByBoth, Variant1], allOf[RequiredByBoth, Variant2]]

This is both painful to read and is a lot of extra code to write when you actually expand it all into classes (each oneOf/allOf is another class). Class OneOfKeywordSchema will actually simplify this by automatically making the allOf definitions for you if it detects other schema nodes than oneOf specified in the class bases. You can still do the full oneOf/allOf classes expansion manually though, it will result into the same specification.

Warning

When oneOf/allOf automatic expansion occurs during schema generation

Warning

When calling deserialize(), because the validation process requires exactly one of the variants to succeed to consider the whole object to evaluate as valid, it is important to insert more permissive validators later in the _one_of iterator (or validator keyword). For example, having a variant with all fields defined as optional (ie: with missing=drop) inserted as first item in _one_of will make it always succeed regardless of following variants (since an empty schema with everything dropped is valid for optional-only elements). This would have as side effect of potentially failing the validation if other object are also valid depending on the received schema because the schema cannot be discriminated between many. If this occurs, it means the your schemas are too permissive.

In the event that you have very similar schemas that can sometime match except one identifier (e.g.: field type defining the type of object), consider adding a validator to each sub-node with explicit values to solve the discrimination problem.

As a shortcut, the OpenAPI keyword discriminator can be provided to try matching as a last resort.

For example:

class Animal(ExtendedMappingSchema):
    name = ExtendedSchemaNode(String())
    type = ExtendedSchemaNode(String())  # with explicit definition, this shouldn't be here

    ## With explicit definitions, each below 'Animal' class should be defined as follows
    ## type = ExtendedSchemaNode(String(), validator=colander.OneOf(['<animal>']))

class Cat(Animal):
    [...]   # many **OPTIONAL** fields

class Dog(Animal):
    [...]   # many **OPTIONAL** fields

# With the discriminator keyword, following is possible
class SomeAnimal(OneOfMappingSchema):
    discriminator = {
        "propertyName": "type",     # correspond to 'type' of 'Animal'
        "mapping": {
            "cat": Cat, "dog": Dog  # map expected values to target schemas
        }
    }
    _one_of = [
        Cat(),
        Dog(),
    ]

Note

Keyword discriminator supports a map of key-string to schemas-type as presented in the example, and the key must be located at the top level of the mapping. If only discriminator = "<field>" is provided, the definition will be created automatically using the example (which should be only the matching value) of the corresponding field of each node within the _one_of mapping.

When multiple valid schemas are matched against the input data, the error will be raised and returned with corresponding erroneous elements for each sub-schema (fully listed).

See also

  • AllOfKeywordSchema

  • AnyOfKeywordSchema

  • NotKeywordSchema

_one_of[source]
class weaver.wps_restapi.swagger_definitions.CWLTypeSymbols(*args, **kwargs)[source]

Combines DefaultSequenceSchema and DefaultSequenceSchema extensions so that default keyword is used first to resolve a missing sequence during deserialize() call, and then removes the node completely if no default was provided.

See also

  • ExtendedSchemaNode

  • ExtendedMappingSchema

symbol[source]
class weaver.wps_restapi.swagger_definitions.CWLTypeArray(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

type[source]
items[source]
class weaver.wps_restapi.swagger_definitions.CWLTypeEnum(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

type[source]
symbols[source]
class weaver.wps_restapi.swagger_definitions.CWLTypeBase(*args, **kwargs)[source]

Allows specifying multiple supported mapping schemas variants for an underlying schema definition. Corresponds to the oneOf specifier of OpenAPI specification.

Example:

class Variant1(MappingSchema):
    [...fields of Variant1...]

class Variant2(MappingSchema):
    [...fields of Variant2...]

class RequiredByBoth(MappingSchema):
    [...fields required by both Variant1 and Variant2...]

class OneOfWithRequiredFields(OneOfKeywordSchema, RequiredByBoth):
    _one_of = (Variant1, Variant2)
    [...alternatively, field required by all variants here...]

In the above example, the validation (ie: deserialize) process will succeed if only one of the _one_of variants’ validator completely succeed, and will fail if every variant fails validation execution. The operation will also fail if more than one validation succeeds.

Note

Class OneOfWithRequiredFields in the example is a shortcut variant to generate a specification that represents the pseudo-code oneOf([<list-of-objects-with-same-base>]).

The real OpenAPI method to implement the above very commonly occurring situation is as presented by the following pseudo-code:

oneOf[allOf[RequiredByBoth, Variant1], allOf[RequiredByBoth, Variant2]]

This is both painful to read and is a lot of extra code to write when you actually expand it all into classes (each oneOf/allOf is another class). Class OneOfKeywordSchema will actually simplify this by automatically making the allOf definitions for you if it detects other schema nodes than oneOf specified in the class bases. You can still do the full oneOf/allOf classes expansion manually though, it will result into the same specification.

Warning

When oneOf/allOf automatic expansion occurs during schema generation

Warning

When calling deserialize(), because the validation process requires exactly one of the variants to succeed to consider the whole object to evaluate as valid, it is important to insert more permissive validators later in the _one_of iterator (or validator keyword). For example, having a variant with all fields defined as optional (ie: with missing=drop) inserted as first item in _one_of will make it always succeed regardless of following variants (since an empty schema with everything dropped is valid for optional-only elements). This would have as side effect of potentially failing the validation if other object are also valid depending on the received schema because the schema cannot be discriminated between many. If this occurs, it means the your schemas are too permissive.

In the event that you have very similar schemas that can sometime match except one identifier (e.g.: field type defining the type of object), consider adding a validator to each sub-node with explicit values to solve the discrimination problem.

As a shortcut, the OpenAPI keyword discriminator can be provided to try matching as a last resort.

For example:

class Animal(ExtendedMappingSchema):
    name = ExtendedSchemaNode(String())
    type = ExtendedSchemaNode(String())  # with explicit definition, this shouldn't be here

    ## With explicit definitions, each below 'Animal' class should be defined as follows
    ## type = ExtendedSchemaNode(String(), validator=colander.OneOf(['<animal>']))

class Cat(Animal):
    [...]   # many **OPTIONAL** fields

class Dog(Animal):
    [...]   # many **OPTIONAL** fields

# With the discriminator keyword, following is possible
class SomeAnimal(OneOfMappingSchema):
    discriminator = {
        "propertyName": "type",     # correspond to 'type' of 'Animal'
        "mapping": {
            "cat": Cat, "dog": Dog  # map expected values to target schemas
        }
    }
    _one_of = [
        Cat(),
        Dog(),
    ]

Note

Keyword discriminator supports a map of key-string to schemas-type as presented in the example, and the key must be located at the top level of the mapping. If only discriminator = "<field>" is provided, the definition will be created automatically using the example (which should be only the matching value) of the corresponding field of each node within the _one_of mapping.

When multiple valid schemas are matched against the input data, the error will be raised and returned with corresponding erroneous elements for each sub-schema (fully listed).

See also

  • AllOfKeywordSchema

  • AnyOfKeywordSchema

  • NotKeywordSchema

_one_of[source]
class weaver.wps_restapi.swagger_definitions.CWLTypeList(*args, **kwargs)[source]

Combines DefaultSequenceSchema and DefaultSequenceSchema extensions so that default keyword is used first to resolve a missing sequence during deserialize() call, and then removes the node completely if no default was provided.

See also

  • ExtendedSchemaNode

  • ExtendedMappingSchema

type[source]
class weaver.wps_restapi.swagger_definitions.CWLType(*args, **kwargs)[source]

Allows specifying multiple supported mapping schemas variants for an underlying schema definition. Corresponds to the oneOf specifier of OpenAPI specification.

Example:

class Variant1(MappingSchema):
    [...fields of Variant1...]

class Variant2(MappingSchema):
    [...fields of Variant2...]

class RequiredByBoth(MappingSchema):
    [...fields required by both Variant1 and Variant2...]

class OneOfWithRequiredFields(OneOfKeywordSchema, RequiredByBoth):
    _one_of = (Variant1, Variant2)
    [...alternatively, field required by all variants here...]

In the above example, the validation (ie: deserialize) process will succeed if only one of the _one_of variants’ validator completely succeed, and will fail if every variant fails validation execution. The operation will also fail if more than one validation succeeds.

Note

Class OneOfWithRequiredFields in the example is a shortcut variant to generate a specification that represents the pseudo-code oneOf([<list-of-objects-with-same-base>]).

The real OpenAPI method to implement the above very commonly occurring situation is as presented by the following pseudo-code:

oneOf[allOf[RequiredByBoth, Variant1], allOf[RequiredByBoth, Variant2]]

This is both painful to read and is a lot of extra code to write when you actually expand it all into classes (each oneOf/allOf is another class). Class OneOfKeywordSchema will actually simplify this by automatically making the allOf definitions for you if it detects other schema nodes than oneOf specified in the class bases. You can still do the full oneOf/allOf classes expansion manually though, it will result into the same specification.

Warning

When oneOf/allOf automatic expansion occurs during schema generation

Warning

When calling deserialize(), because the validation process requires exactly one of the variants to succeed to consider the whole object to evaluate as valid, it is important to insert more permissive validators later in the _one_of iterator (or validator keyword). For example, having a variant with all fields defined as optional (ie: with missing=drop) inserted as first item in _one_of will make it always succeed regardless of following variants (since an empty schema with everything dropped is valid for optional-only elements). This would have as side effect of potentially failing the validation if other object are also valid depending on the received schema because the schema cannot be discriminated between many. If this occurs, it means the your schemas are too permissive.

In the event that you have very similar schemas that can sometime match except one identifier (e.g.: field type defining the type of object), consider adding a validator to each sub-node with explicit values to solve the discrimination problem.

As a shortcut, the OpenAPI keyword discriminator can be provided to try matching as a last resort.

For example:

class Animal(ExtendedMappingSchema):
    name = ExtendedSchemaNode(String())
    type = ExtendedSchemaNode(String())  # with explicit definition, this shouldn't be here

    ## With explicit definitions, each below 'Animal' class should be defined as follows
    ## type = ExtendedSchemaNode(String(), validator=colander.OneOf(['<animal>']))

class Cat(Animal):
    [...]   # many **OPTIONAL** fields

class Dog(Animal):
    [...]   # many **OPTIONAL** fields

# With the discriminator keyword, following is possible
class SomeAnimal(OneOfMappingSchema):
    discriminator = {
        "propertyName": "type",     # correspond to 'type' of 'Animal'
        "mapping": {
            "cat": Cat, "dog": Dog  # map expected values to target schemas
        }
    }
    _one_of = [
        Cat(),
        Dog(),
    ]

Note

Keyword discriminator supports a map of key-string to schemas-type as presented in the example, and the key must be located at the top level of the mapping. If only discriminator = "<field>" is provided, the definition will be created automatically using the example (which should be only the matching value) of the corresponding field of each node within the _one_of mapping.

When multiple valid schemas are matched against the input data, the error will be raised and returned with corresponding erroneous elements for each sub-schema (fully listed).

See also

  • AllOfKeywordSchema

  • AnyOfKeywordSchema

  • NotKeywordSchema

title = CWL Type[source]
_one_of[source]
class weaver.wps_restapi.swagger_definitions.AnyLiteralList(*args, **kwargs)[source]

Combines DefaultSequenceSchema and DefaultSequenceSchema extensions so that default keyword is used first to resolve a missing sequence during deserialize() call, and then removes the node completely if no default was provided.

See also

  • ExtendedSchemaNode

  • ExtendedMappingSchema

default[source]
class weaver.wps_restapi.swagger_definitions.CWLDefault(*args, **kwargs)[source]

Allows specifying multiple supported mapping schemas variants for an underlying schema definition. Corresponds to the oneOf specifier of OpenAPI specification.

Example:

class Variant1(MappingSchema):
    [...fields of Variant1...]

class Variant2(MappingSchema):
    [...fields of Variant2...]

class RequiredByBoth(MappingSchema):
    [...fields required by both Variant1 and Variant2...]

class OneOfWithRequiredFields(OneOfKeywordSchema, RequiredByBoth):
    _one_of = (Variant1, Variant2)
    [...alternatively, field required by all variants here...]

In the above example, the validation (ie: deserialize) process will succeed if only one of the _one_of variants’ validator completely succeed, and will fail if every variant fails validation execution. The operation will also fail if more than one validation succeeds.

Note

Class OneOfWithRequiredFields in the example is a shortcut variant to generate a specification that represents the pseudo-code oneOf([<list-of-objects-with-same-base>]).

The real OpenAPI method to implement the above very commonly occurring situation is as presented by the following pseudo-code:

oneOf[allOf[RequiredByBoth, Variant1], allOf[RequiredByBoth, Variant2]]

This is both painful to read and is a lot of extra code to write when you actually expand it all into classes (each oneOf/allOf is another class). Class OneOfKeywordSchema will actually simplify this by automatically making the allOf definitions for you if it detects other schema nodes than oneOf specified in the class bases. You can still do the full oneOf/allOf classes expansion manually though, it will result into the same specification.

Warning

When oneOf/allOf automatic expansion occurs during schema generation

Warning

When calling deserialize(), because the validation process requires exactly one of the variants to succeed to consider the whole object to evaluate as valid, it is important to insert more permissive validators later in the _one_of iterator (or validator keyword). For example, having a variant with all fields defined as optional (ie: with missing=drop) inserted as first item in _one_of will make it always succeed regardless of following variants (since an empty schema with everything dropped is valid for optional-only elements). This would have as side effect of potentially failing the validation if other object are also valid depending on the received schema because the schema cannot be discriminated between many. If this occurs, it means the your schemas are too permissive.

In the event that you have very similar schemas that can sometime match except one identifier (e.g.: field type defining the type of object), consider adding a validator to each sub-node with explicit values to solve the discrimination problem.

As a shortcut, the OpenAPI keyword discriminator can be provided to try matching as a last resort.

For example:

class Animal(ExtendedMappingSchema):
    name = ExtendedSchemaNode(String())
    type = ExtendedSchemaNode(String())  # with explicit definition, this shouldn't be here

    ## With explicit definitions, each below 'Animal' class should be defined as follows
    ## type = ExtendedSchemaNode(String(), validator=colander.OneOf(['<animal>']))

class Cat(Animal):
    [...]   # many **OPTIONAL** fields

class Dog(Animal):
    [...]   # many **OPTIONAL** fields

# With the discriminator keyword, following is possible
class SomeAnimal(OneOfMappingSchema):
    discriminator = {
        "propertyName": "type",     # correspond to 'type' of 'Animal'
        "mapping": {
            "cat": Cat, "dog": Dog  # map expected values to target schemas
        }
    }
    _one_of = [
        Cat(),
        Dog(),
    ]

Note

Keyword discriminator supports a map of key-string to schemas-type as presented in the example, and the key must be located at the top level of the mapping. If only discriminator = "<field>" is provided, the definition will be created automatically using the example (which should be only the matching value) of the corresponding field of each node within the _one_of mapping.

When multiple valid schemas are matched against the input data, the error will be raised and returned with corresponding erroneous elements for each sub-schema (fully listed).

See also

  • AllOfKeywordSchema

  • AnyOfKeywordSchema

  • NotKeywordSchema

_one_of[source]
class weaver.wps_restapi.swagger_definitions.CWLInputObject(*args, **kwargs)[source]

Object schema that will allow any unknown field to remain present in the resulting deserialization.

This type is useful for defining a dictionary where some field names are not known in advance, or when more optional keys that don’t need to all be exhaustively provided in the schema are acceptable.

When doing schema deserialization to validate it, unknown keys would normally be removed without this class (default behaviour is to ignore them). With this schema, content under an unknown key is preserved as it was received without any validation. Other fields that are explicitly specified with sub-schema nodes will still be validated as per usual behaviour.

Example:

class AnyKeyObject(PermissiveMappingSchema):
    known_key = SchemaNode(String())

AnyKeyObject().deserialize({"unknown": "kept", "known_key": "requirement"}))
# result: dictionary returned as is instead of removing 'unknown' entry
#         'known_key' is still validated with its string schema

Note

This class is only a shorthand definition of unknown keyword for convenience. All colander.MappingSchema support this natively.

type[source]
default[source]
inputBinding[source]
class weaver.wps_restapi.swagger_definitions.CWLTypeStringList(*args, **kwargs)[source]

Combines DefaultSequenceSchema and DefaultSequenceSchema extensions so that default keyword is used first to resolve a missing sequence during deserialize() call, and then removes the node completely if no default was provided.

See also

  • ExtendedSchemaNode

  • ExtendedMappingSchema

description = List of allowed direct CWL type specifications as strings.[source]
type[source]
class weaver.wps_restapi.swagger_definitions.CWLInputType(*args, **kwargs)[source]

Allows specifying multiple supported mapping schemas variants for an underlying schema definition. Corresponds to the oneOf specifier of OpenAPI specification.

Example:

class Variant1(MappingSchema):
    [...fields of Variant1...]

class Variant2(MappingSchema):
    [...fields of Variant2...]

class RequiredByBoth(MappingSchema):
    [...fields required by both Variant1 and Variant2...]

class OneOfWithRequiredFields(OneOfKeywordSchema, RequiredByBoth):
    _one_of = (Variant1, Variant2)
    [...alternatively, field required by all variants here...]

In the above example, the validation (ie: deserialize) process will succeed if only one of the _one_of variants’ validator completely succeed, and will fail if every variant fails validation execution. The operation will also fail if more than one validation succeeds.

Note

Class OneOfWithRequiredFields in the example is a shortcut variant to generate a specification that represents the pseudo-code oneOf([<list-of-objects-with-same-base>]).

The real OpenAPI method to implement the above very commonly occurring situation is as presented by the following pseudo-code:

oneOf[allOf[RequiredByBoth, Variant1], allOf[RequiredByBoth, Variant2]]

This is both painful to read and is a lot of extra code to write when you actually expand it all into classes (each oneOf/allOf is another class). Class OneOfKeywordSchema will actually simplify this by automatically making the allOf definitions for you if it detects other schema nodes than oneOf specified in the class bases. You can still do the full oneOf/allOf classes expansion manually though, it will result into the same specification.

Warning

When oneOf/allOf automatic expansion occurs during schema generation

Warning

When calling deserialize(), because the validation process requires exactly one of the variants to succeed to consider the whole object to evaluate as valid, it is important to insert more permissive validators later in the _one_of iterator (or validator keyword). For example, having a variant with all fields defined as optional (ie: with missing=drop) inserted as first item in _one_of will make it always succeed regardless of following variants (since an empty schema with everything dropped is valid for optional-only elements). This would have as side effect of potentially failing the validation if other object are also valid depending on the received schema because the schema cannot be discriminated between many. If this occurs, it means the your schemas are too permissive.

In the event that you have very similar schemas that can sometime match except one identifier (e.g.: field type defining the type of object), consider adding a validator to each sub-node with explicit values to solve the discrimination problem.

As a shortcut, the OpenAPI keyword discriminator can be provided to try matching as a last resort.

For example:

class Animal(ExtendedMappingSchema):
    name = ExtendedSchemaNode(String())
    type = ExtendedSchemaNode(String())  # with explicit definition, this shouldn't be here

    ## With explicit definitions, each below 'Animal' class should be defined as follows
    ## type = ExtendedSchemaNode(String(), validator=colander.OneOf(['<animal>']))

class Cat(Animal):
    [...]   # many **OPTIONAL** fields

class Dog(Animal):
    [...]   # many **OPTIONAL** fields

# With the discriminator keyword, following is possible
class SomeAnimal(OneOfMappingSchema):
    discriminator = {
        "propertyName": "type",     # correspond to 'type' of 'Animal'
        "mapping": {
            "cat": Cat, "dog": Dog  # map expected values to target schemas
        }
    }
    _one_of = [
        Cat(),
        Dog(),
    ]

Note

Keyword discriminator supports a map of key-string to schemas-type as presented in the example, and the key must be located at the top level of the mapping. If only discriminator = "<field>" is provided, the definition will be created automatically using the example (which should be only the matching value) of the corresponding field of each node within the _one_of mapping.

When multiple valid schemas are matched against the input data, the error will be raised and returned with corresponding erroneous elements for each sub-schema (fully listed).

See also

  • AllOfKeywordSchema

  • AnyOfKeywordSchema

  • NotKeywordSchema

description = CWL type definition of the input.[source]
_one_of[source]
class weaver.wps_restapi.swagger_definitions.CWLInputMap(*args, **kwargs)[source]

Object schema that will allow any unknown field to remain present in the resulting deserialization.

This type is useful for defining a dictionary where some field names are not known in advance, or when more optional keys that don’t need to all be exhaustively provided in the schema are acceptable.

When doing schema deserialization to validate it, unknown keys would normally be removed without this class (default behaviour is to ignore them). With this schema, content under an unknown key is preserved as it was received without any validation. Other fields that are explicitly specified with sub-schema nodes will still be validated as per usual behaviour.

Example:

class AnyKeyObject(PermissiveMappingSchema):
    known_key = SchemaNode(String())

AnyKeyObject().deserialize({"unknown": "kept", "known_key": "requirement"}))
# result: dictionary returned as is instead of removing 'unknown' entry
#         'known_key' is still validated with its string schema

Note

This class is only a shorthand definition of unknown keyword for convenience. All colander.MappingSchema support this natively.

input_id[source]
class weaver.wps_restapi.swagger_definitions.CWLInputItem(*args, **kwargs)[source]

Object schema that will allow any unknown field to remain present in the resulting deserialization.

This type is useful for defining a dictionary where some field names are not known in advance, or when more optional keys that don’t need to all be exhaustively provided in the schema are acceptable.

When doing schema deserialization to validate it, unknown keys would normally be removed without this class (default behaviour is to ignore them). With this schema, content under an unknown key is preserved as it was received without any validation. Other fields that are explicitly specified with sub-schema nodes will still be validated as per usual behaviour.

Example:

class AnyKeyObject(PermissiveMappingSchema):
    known_key = SchemaNode(String())

AnyKeyObject().deserialize({"unknown": "kept", "known_key": "requirement"}))
# result: dictionary returned as is instead of removing 'unknown' entry
#         'known_key' is still validated with its string schema

Note

This class is only a shorthand definition of unknown keyword for convenience. All colander.MappingSchema support this natively.

id[source]
class weaver.wps_restapi.swagger_definitions.CWLInputList(*args, **kwargs)[source]

Combines DefaultSequenceSchema and DefaultSequenceSchema extensions so that default keyword is used first to resolve a missing sequence during deserialize() call, and then removes the node completely if no default was provided.

See also

  • ExtendedSchemaNode

  • ExtendedMappingSchema

input[source]
class weaver.wps_restapi.swagger_definitions.CWLInputsDefinition(*args, **kwargs)[source]

Allows specifying multiple supported mapping schemas variants for an underlying schema definition. Corresponds to the oneOf specifier of OpenAPI specification.

Example:

class Variant1(MappingSchema):
    [...fields of Variant1...]

class Variant2(MappingSchema):
    [...fields of Variant2...]

class RequiredByBoth(MappingSchema):
    [...fields required by both Variant1 and Variant2...]

class OneOfWithRequiredFields(OneOfKeywordSchema, RequiredByBoth):
    _one_of = (Variant1, Variant2)
    [...alternatively, field required by all variants here...]

In the above example, the validation (ie: deserialize) process will succeed if only one of the _one_of variants’ validator completely succeed, and will fail if every variant fails validation execution. The operation will also fail if more than one validation succeeds.

Note

Class OneOfWithRequiredFields in the example is a shortcut variant to generate a specification that represents the pseudo-code oneOf([<list-of-objects-with-same-base>]).

The real OpenAPI method to implement the above very commonly occurring situation is as presented by the following pseudo-code:

oneOf[allOf[RequiredByBoth, Variant1], allOf[RequiredByBoth, Variant2]]

This is both painful to read and is a lot of extra code to write when you actually expand it all into classes (each oneOf/allOf is another class). Class OneOfKeywordSchema will actually simplify this by automatically making the allOf definitions for you if it detects other schema nodes than oneOf specified in the class bases. You can still do the full oneOf/allOf classes expansion manually though, it will result into the same specification.

Warning

When oneOf/allOf automatic expansion occurs during schema generation

Warning

When calling deserialize(), because the validation process requires exactly one of the variants to succeed to consider the whole object to evaluate as valid, it is important to insert more permissive validators later in the _one_of iterator (or validator keyword). For example, having a variant with all fields defined as optional (ie: with missing=drop) inserted as first item in _one_of will make it always succeed regardless of following variants (since an empty schema with everything dropped is valid for optional-only elements). This would have as side effect of potentially failing the validation if other object are also valid depending on the received schema because the schema cannot be discriminated between many. If this occurs, it means the your schemas are too permissive.

In the event that you have very similar schemas that can sometime match except one identifier (e.g.: field type defining the type of object), consider adding a validator to each sub-node with explicit values to solve the discrimination problem.

As a shortcut, the OpenAPI keyword discriminator can be provided to try matching as a last resort.

For example:

class Animal(ExtendedMappingSchema):
    name = ExtendedSchemaNode(String())
    type = ExtendedSchemaNode(String())  # with explicit definition, this shouldn't be here

    ## With explicit definitions, each below 'Animal' class should be defined as follows
    ## type = ExtendedSchemaNode(String(), validator=colander.OneOf(['<animal>']))

class Cat(Animal):
    [...]   # many **OPTIONAL** fields

class Dog(Animal):
    [...]   # many **OPTIONAL** fields

# With the discriminator keyword, following is possible
class SomeAnimal(OneOfMappingSchema):
    discriminator = {
        "propertyName": "type",     # correspond to 'type' of 'Animal'
        "mapping": {
            "cat": Cat, "dog": Dog  # map expected values to target schemas
        }
    }
    _one_of = [
        Cat(),
        Dog(),
    ]

Note

Keyword discriminator supports a map of key-string to schemas-type as presented in the example, and the key must be located at the top level of the mapping. If only discriminator = "<field>" is provided, the definition will be created automatically using the example (which should be only the matching value) of the corresponding field of each node within the _one_of mapping.

When multiple valid schemas are matched against the input data, the error will be raised and returned with corresponding erroneous elements for each sub-schema (fully listed).

See also

  • AllOfKeywordSchema

  • AnyOfKeywordSchema

  • NotKeywordSchema

_one_of[source]
class weaver.wps_restapi.swagger_definitions.OutputBinding(*args, **kwargs)[source]

Object schema that will allow any unknown field to remain present in the resulting deserialization.

This type is useful for defining a dictionary where some field names are not known in advance, or when more optional keys that don’t need to all be exhaustively provided in the schema are acceptable.

When doing schema deserialization to validate it, unknown keys would normally be removed without this class (default behaviour is to ignore them). With this schema, content under an unknown key is preserved as it was received without any validation. Other fields that are explicitly specified with sub-schema nodes will still be validated as per usual behaviour.

Example:

class AnyKeyObject(PermissiveMappingSchema):
    known_key = SchemaNode(String())

AnyKeyObject().deserialize({"unknown": "kept", "known_key": "requirement"}))
# result: dictionary returned as is instead of removing 'unknown' entry
#         'known_key' is still validated with its string schema

Note

This class is only a shorthand definition of unknown keyword for convenience. All colander.MappingSchema support this natively.

glob[source]
class weaver.wps_restapi.swagger_definitions.CWLOutputObject(*args, **kwargs)[source]

Object schema that will allow any unknown field to remain present in the resulting deserialization.

This type is useful for defining a dictionary where some field names are not known in advance, or when more optional keys that don’t need to all be exhaustively provided in the schema are acceptable.

When doing schema deserialization to validate it, unknown keys would normally be removed without this class (default behaviour is to ignore them). With this schema, content under an unknown key is preserved as it was received without any validation. Other fields that are explicitly specified with sub-schema nodes will still be validated as per usual behaviour.

Example:

class AnyKeyObject(PermissiveMappingSchema):
    known_key = SchemaNode(String())

AnyKeyObject().deserialize({"unknown": "kept", "known_key": "requirement"}))
# result: dictionary returned as is instead of removing 'unknown' entry
#         'known_key' is still validated with its string schema

Note

This class is only a shorthand definition of unknown keyword for convenience. All colander.MappingSchema support this natively.

type[source]
outputBinding[source]
class weaver.wps_restapi.swagger_definitions.CWLOutputType(*args, **kwargs)[source]

Allows specifying multiple supported mapping schemas variants for an underlying schema definition. Corresponds to the oneOf specifier of OpenAPI specification.

Example:

class Variant1(MappingSchema):
    [...fields of Variant1...]

class Variant2(MappingSchema):
    [...fields of Variant2...]

class RequiredByBoth(MappingSchema):
    [...fields required by both Variant1 and Variant2...]

class OneOfWithRequiredFields(OneOfKeywordSchema, RequiredByBoth):
    _one_of = (Variant1, Variant2)
    [...alternatively, field required by all variants here...]

In the above example, the validation (ie: deserialize) process will succeed if only one of the _one_of variants’ validator completely succeed, and will fail if every variant fails validation execution. The operation will also fail if more than one validation succeeds.

Note

Class OneOfWithRequiredFields in the example is a shortcut variant to generate a specification that represents the pseudo-code oneOf([<list-of-objects-with-same-base>]).

The real OpenAPI method to implement the above very commonly occurring situation is as presented by the following pseudo-code:

oneOf[allOf[RequiredByBoth, Variant1], allOf[RequiredByBoth, Variant2]]

This is both painful to read and is a lot of extra code to write when you actually expand it all into classes (each oneOf/allOf is another class). Class OneOfKeywordSchema will actually simplify this by automatically making the allOf definitions for you if it detects other schema nodes than oneOf specified in the class bases. You can still do the full oneOf/allOf classes expansion manually though, it will result into the same specification.

Warning

When oneOf/allOf automatic expansion occurs during schema generation

Warning

When calling deserialize(), because the validation process requires exactly one of the variants to succeed to consider the whole object to evaluate as valid, it is important to insert more permissive validators later in the _one_of iterator (or validator keyword). For example, having a variant with all fields defined as optional (ie: with missing=drop) inserted as first item in _one_of will make it always succeed regardless of following variants (since an empty schema with everything dropped is valid for optional-only elements). This would have as side effect of potentially failing the validation if other object are also valid depending on the received schema because the schema cannot be discriminated between many. If this occurs, it means the your schemas are too permissive.

In the event that you have very similar schemas that can sometime match except one identifier (e.g.: field type defining the type of object), consider adding a validator to each sub-node with explicit values to solve the discrimination problem.

As a shortcut, the OpenAPI keyword discriminator can be provided to try matching as a last resort.

For example:

class Animal(ExtendedMappingSchema):
    name = ExtendedSchemaNode(String())
    type = ExtendedSchemaNode(String())  # with explicit definition, this shouldn't be here

    ## With explicit definitions, each below 'Animal' class should be defined as follows
    ## type = ExtendedSchemaNode(String(), validator=colander.OneOf(['<animal>']))

class Cat(Animal):
    [...]   # many **OPTIONAL** fields

class Dog(Animal):
    [...]   # many **OPTIONAL** fields

# With the discriminator keyword, following is possible
class SomeAnimal(OneOfMappingSchema):
    discriminator = {
        "propertyName": "type",     # correspond to 'type' of 'Animal'
        "mapping": {
            "cat": Cat, "dog": Dog  # map expected values to target schemas
        }
    }
    _one_of = [
        Cat(),
        Dog(),
    ]

Note

Keyword discriminator supports a map of key-string to schemas-type as presented in the example, and the key must be located at the top level of the mapping. If only discriminator = "<field>" is provided, the definition will be created automatically using the example (which should be only the matching value) of the corresponding field of each node within the _one_of mapping.

When multiple valid schemas are matched against the input data, the error will be raised and returned with corresponding erroneous elements for each sub-schema (fully listed).

See also

  • AllOfKeywordSchema

  • AnyOfKeywordSchema

  • NotKeywordSchema

_one_of[source]
class weaver.wps_restapi.swagger_definitions.CWLOutputMap(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

output_id[source]
class weaver.wps_restapi.swagger_definitions.CWLOutputItem(*args, **kwargs)[source]

Object schema that will allow any unknown field to remain present in the resulting deserialization.

This type is useful for defining a dictionary where some field names are not known in advance, or when more optional keys that don’t need to all be exhaustively provided in the schema are acceptable.

When doing schema deserialization to validate it, unknown keys would normally be removed without this class (default behaviour is to ignore them). With this schema, content under an unknown key is preserved as it was received without any validation. Other fields that are explicitly specified with sub-schema nodes will still be validated as per usual behaviour.

Example:

class AnyKeyObject(PermissiveMappingSchema):
    known_key = SchemaNode(String())

AnyKeyObject().deserialize({"unknown": "kept", "known_key": "requirement"}))
# result: dictionary returned as is instead of removing 'unknown' entry
#         'known_key' is still validated with its string schema

Note

This class is only a shorthand definition of unknown keyword for convenience. All colander.MappingSchema support this natively.

id[source]
class weaver.wps_restapi.swagger_definitions.CWLOutputList(*args, **kwargs)[source]

Combines DefaultSequenceSchema and DefaultSequenceSchema extensions so that default keyword is used first to resolve a missing sequence during deserialize() call, and then removes the node completely if no default was provided.

See also

  • ExtendedSchemaNode

  • ExtendedMappingSchema

input[source]
class weaver.wps_restapi.swagger_definitions.CWLOutputsDefinition(*args, **kwargs)[source]

Allows specifying multiple supported mapping schemas variants for an underlying schema definition. Corresponds to the oneOf specifier of OpenAPI specification.

Example:

class Variant1(MappingSchema):
    [...fields of Variant1...]

class Variant2(MappingSchema):
    [...fields of Variant2...]

class RequiredByBoth(MappingSchema):
    [...fields required by both Variant1 and Variant2...]

class OneOfWithRequiredFields(OneOfKeywordSchema, RequiredByBoth):
    _one_of = (Variant1, Variant2)
    [...alternatively, field required by all variants here...]

In the above example, the validation (ie: deserialize) process will succeed if only one of the _one_of variants’ validator completely succeed, and will fail if every variant fails validation execution. The operation will also fail if more than one validation succeeds.

Note

Class OneOfWithRequiredFields in the example is a shortcut variant to generate a specification that represents the pseudo-code oneOf([<list-of-objects-with-same-base>]).

The real OpenAPI method to implement the above very commonly occurring situation is as presented by the following pseudo-code:

oneOf[allOf[RequiredByBoth, Variant1], allOf[RequiredByBoth, Variant2]]

This is both painful to read and is a lot of extra code to write when you actually expand it all into classes (each oneOf/allOf is another class). Class OneOfKeywordSchema will actually simplify this by automatically making the allOf definitions for you if it detects other schema nodes than oneOf specified in the class bases. You can still do the full oneOf/allOf classes expansion manually though, it will result into the same specification.

Warning

When oneOf/allOf automatic expansion occurs during schema generation

Warning

When calling deserialize(), because the validation process requires exactly one of the variants to succeed to consider the whole object to evaluate as valid, it is important to insert more permissive validators later in the _one_of iterator (or validator keyword). For example, having a variant with all fields defined as optional (ie: with missing=drop) inserted as first item in _one_of will make it always succeed regardless of following variants (since an empty schema with everything dropped is valid for optional-only elements). This would have as side effect of potentially failing the validation if other object are also valid depending on the received schema because the schema cannot be discriminated between many. If this occurs, it means the your schemas are too permissive.

In the event that you have very similar schemas that can sometime match except one identifier (e.g.: field type defining the type of object), consider adding a validator to each sub-node with explicit values to solve the discrimination problem.

As a shortcut, the OpenAPI keyword discriminator can be provided to try matching as a last resort.

For example:

class Animal(ExtendedMappingSchema):
    name = ExtendedSchemaNode(String())
    type = ExtendedSchemaNode(String())  # with explicit definition, this shouldn't be here

    ## With explicit definitions, each below 'Animal' class should be defined as follows
    ## type = ExtendedSchemaNode(String(), validator=colander.OneOf(['<animal>']))

class Cat(Animal):
    [...]   # many **OPTIONAL** fields

class Dog(Animal):
    [...]   # many **OPTIONAL** fields

# With the discriminator keyword, following is possible
class SomeAnimal(OneOfMappingSchema):
    discriminator = {
        "propertyName": "type",     # correspond to 'type' of 'Animal'
        "mapping": {
            "cat": Cat, "dog": Dog  # map expected values to target schemas
        }
    }
    _one_of = [
        Cat(),
        Dog(),
    ]

Note

Keyword discriminator supports a map of key-string to schemas-type as presented in the example, and the key must be located at the top level of the mapping. If only discriminator = "<field>" is provided, the definition will be created automatically using the example (which should be only the matching value) of the corresponding field of each node within the _one_of mapping.

When multiple valid schemas are matched against the input data, the error will be raised and returned with corresponding erroneous elements for each sub-schema (fully listed).

See also

  • AllOfKeywordSchema

  • AnyOfKeywordSchema

  • NotKeywordSchema

_one_of[source]
class weaver.wps_restapi.swagger_definitions.CWLCommandParts(*args, **kwargs)[source]

Combines DefaultSequenceSchema and DefaultSequenceSchema extensions so that default keyword is used first to resolve a missing sequence during deserialize() call, and then removes the node completely if no default was provided.

See also

  • ExtendedSchemaNode

  • ExtendedMappingSchema

cmd[source]
class weaver.wps_restapi.swagger_definitions.CWLCommand(*args, **kwargs)[source]

Allows specifying multiple supported mapping schemas variants for an underlying schema definition. Corresponds to the oneOf specifier of OpenAPI specification.

Example:

class Variant1(MappingSchema):
    [...fields of Variant1...]

class Variant2(MappingSchema):
    [...fields of Variant2...]

class RequiredByBoth(MappingSchema):
    [...fields required by both Variant1 and Variant2...]

class OneOfWithRequiredFields(OneOfKeywordSchema, RequiredByBoth):
    _one_of = (Variant1, Variant2)
    [...alternatively, field required by all variants here...]

In the above example, the validation (ie: deserialize) process will succeed if only one of the _one_of variants’ validator completely succeed, and will fail if every variant fails validation execution. The operation will also fail if more than one validation succeeds.

Note

Class OneOfWithRequiredFields in the example is a shortcut variant to generate a specification that represents the pseudo-code oneOf([<list-of-objects-with-same-base>]).

The real OpenAPI method to implement the above very commonly occurring situation is as presented by the following pseudo-code:

oneOf[allOf[RequiredByBoth, Variant1], allOf[RequiredByBoth, Variant2]]

This is both painful to read and is a lot of extra code to write when you actually expand it all into classes (each oneOf/allOf is another class). Class OneOfKeywordSchema will actually simplify this by automatically making the allOf definitions for you if it detects other schema nodes than oneOf specified in the class bases. You can still do the full oneOf/allOf classes expansion manually though, it will result into the same specification.

Warning

When oneOf/allOf automatic expansion occurs during schema generation

Warning

When calling deserialize(), because the validation process requires exactly one of the variants to succeed to consider the whole object to evaluate as valid, it is important to insert more permissive validators later in the _one_of iterator (or validator keyword). For example, having a variant with all fields defined as optional (ie: with missing=drop) inserted as first item in _one_of will make it always succeed regardless of following variants (since an empty schema with everything dropped is valid for optional-only elements). This would have as side effect of potentially failing the validation if other object are also valid depending on the received schema because the schema cannot be discriminated between many. If this occurs, it means the your schemas are too permissive.

In the event that you have very similar schemas that can sometime match except one identifier (e.g.: field type defining the type of object), consider adding a validator to each sub-node with explicit values to solve the discrimination problem.

As a shortcut, the OpenAPI keyword discriminator can be provided to try matching as a last resort.

For example:

class Animal(ExtendedMappingSchema):
    name = ExtendedSchemaNode(String())
    type = ExtendedSchemaNode(String())  # with explicit definition, this shouldn't be here

    ## With explicit definitions, each below 'Animal' class should be defined as follows
    ## type = ExtendedSchemaNode(String(), validator=colander.OneOf(['<animal>']))

class Cat(Animal):
    [...]   # many **OPTIONAL** fields

class Dog(Animal):
    [...]   # many **OPTIONAL** fields

# With the discriminator keyword, following is possible
class SomeAnimal(OneOfMappingSchema):
    discriminator = {
        "propertyName": "type",     # correspond to 'type' of 'Animal'
        "mapping": {
            "cat": Cat, "dog": Dog  # map expected values to target schemas
        }
    }
    _one_of = [
        Cat(),
        Dog(),
    ]

Note

Keyword discriminator supports a map of key-string to schemas-type as presented in the example, and the key must be located at the top level of the mapping. If only discriminator = "<field>" is provided, the definition will be created automatically using the example (which should be only the matching value) of the corresponding field of each node within the _one_of mapping.

When multiple valid schemas are matched against the input data, the error will be raised and returned with corresponding erroneous elements for each sub-schema (fully listed).

See also

  • AllOfKeywordSchema

  • AnyOfKeywordSchema

  • NotKeywordSchema

_one_of[source]
class weaver.wps_restapi.swagger_definitions.CWLVersion(*args, **kwargs)[source]

Combines all colander.SchemaNode extensions so that default keyword is used first to resolve a missing field value during deserialize() call, and then removes the node completely if no default was provided, and evaluate variables as needed.

See also

  • ExtendedMappingSchema

  • ExtendedSequenceSchema

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

description = CWL version of the described application package.[source]
example[source]
validator[source]
class weaver.wps_restapi.swagger_definitions.CWL(*args, **kwargs)[source]

Object schema that will allow any unknown field to remain present in the resulting deserialization.

This type is useful for defining a dictionary where some field names are not known in advance, or when more optional keys that don’t need to all be exhaustively provided in the schema are acceptable.

When doing schema deserialization to validate it, unknown keys would normally be removed without this class (default behaviour is to ignore them). With this schema, content under an unknown key is preserved as it was received without any validation. Other fields that are explicitly specified with sub-schema nodes will still be validated as per usual behaviour.

Example:

class AnyKeyObject(PermissiveMappingSchema):
    known_key = SchemaNode(String())

AnyKeyObject().deserialize({"unknown": "kept", "known_key": "requirement"}))
# result: dictionary returned as is instead of removing 'unknown' entry
#         'known_key' is still validated with its string schema

Note

This class is only a shorthand definition of unknown keyword for convenience. All colander.MappingSchema support this natively.

cwlVersion[source]
_class[source]
requirements[source]
hints[source]
baseCommand[source]
arguments[source]
inputs[source]
outputs[source]
class weaver.wps_restapi.swagger_definitions.Unit(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

unit[source]
class weaver.wps_restapi.swagger_definitions.ProcessInputDefaultValues(*args, **kwargs)[source]

Combines DefaultSequenceSchema and DefaultSequenceSchema extensions so that default keyword is used first to resolve a missing sequence during deserialize() call, and then removes the node completely if no default was provided.

See also

  • ExtendedSchemaNode

  • ExtendedMappingSchema

value[source]
class weaver.wps_restapi.swagger_definitions.ProcessInputSupportedValues(*args, **kwargs)[source]

Combines DefaultSequenceSchema and DefaultSequenceSchema extensions so that default keyword is used first to resolve a missing sequence during deserialize() call, and then removes the node completely if no default was provided.

See also

  • ExtendedSchemaNode

  • ExtendedMappingSchema

value[source]
class weaver.wps_restapi.swagger_definitions.ProcessInputDescriptionSchema(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

id[source]
title[source]
dataType[source]
abstract[source]
minOccurs[source]
maxOccurs[source]
defaultValue[source]
supportedValues[source]
class weaver.wps_restapi.swagger_definitions.ProcessInputDescriptionList(*args, **kwargs)[source]

Combines DefaultSequenceSchema and DefaultSequenceSchema extensions so that default keyword is used first to resolve a missing sequence during deserialize() call, and then removes the node completely if no default was provided.

See also

  • ExtendedSchemaNode

  • ExtendedMappingSchema

input[source]
class weaver.wps_restapi.swagger_definitions.ProcessOutputDescriptionList(*args, **kwargs)[source]

Combines DefaultSequenceSchema and DefaultSequenceSchema extensions so that default keyword is used first to resolve a missing sequence during deserialize() call, and then removes the node completely if no default was provided.

See also

  • ExtendedSchemaNode

  • ExtendedMappingSchema

input[source]
class weaver.wps_restapi.swagger_definitions.ProcessDescriptionSchema(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

id[source]
label[source]
description[source]
inputs[source]
outputs[source]
class weaver.wps_restapi.swagger_definitions.UndeploymentResult(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

id[source]
class weaver.wps_restapi.swagger_definitions.DeploymentResult(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

processSummary[source]
class weaver.wps_restapi.swagger_definitions.ProcessDescriptionBodySchema(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

process[source]
class weaver.wps_restapi.swagger_definitions.ProvidersSchema(*args, **kwargs)[source]

Combines DefaultSequenceSchema and DefaultSequenceSchema extensions so that default keyword is used first to resolve a missing sequence during deserialize() call, and then removes the node completely if no default was provided.

See also

  • ExtendedSchemaNode

  • ExtendedMappingSchema

providers_service[source]
class weaver.wps_restapi.swagger_definitions.ProcessesSchema(*args, **kwargs)[source]

Combines DefaultSequenceSchema and DefaultSequenceSchema extensions so that default keyword is used first to resolve a missing sequence during deserialize() call, and then removes the node completely if no default was provided.

See also

  • ExtendedSchemaNode

  • ExtendedMappingSchema

provider_processes_service[source]
class weaver.wps_restapi.swagger_definitions.JobOutputValue(*args, **kwargs)[source]

Allows specifying multiple supported mapping schemas variants for an underlying schema definition. Corresponds to the oneOf specifier of OpenAPI specification.

Example:

class Variant1(MappingSchema):
    [...fields of Variant1...]

class Variant2(MappingSchema):
    [...fields of Variant2...]

class RequiredByBoth(MappingSchema):
    [...fields required by both Variant1 and Variant2...]

class OneOfWithRequiredFields(OneOfKeywordSchema, RequiredByBoth):
    _one_of = (Variant1, Variant2)
    [...alternatively, field required by all variants here...]

In the above example, the validation (ie: deserialize) process will succeed if only one of the _one_of variants’ validator completely succeed, and will fail if every variant fails validation execution. The operation will also fail if more than one validation succeeds.

Note

Class OneOfWithRequiredFields in the example is a shortcut variant to generate a specification that represents the pseudo-code oneOf([<list-of-objects-with-same-base>]).

The real OpenAPI method to implement the above very commonly occurring situation is as presented by the following pseudo-code:

oneOf[allOf[RequiredByBoth, Variant1], allOf[RequiredByBoth, Variant2]]

This is both painful to read and is a lot of extra code to write when you actually expand it all into classes (each oneOf/allOf is another class). Class OneOfKeywordSchema will actually simplify this by automatically making the allOf definitions for you if it detects other schema nodes than oneOf specified in the class bases. You can still do the full oneOf/allOf classes expansion manually though, it will result into the same specification.

Warning

When oneOf/allOf automatic expansion occurs during schema generation

Warning

When calling deserialize(), because the validation process requires exactly one of the variants to succeed to consider the whole object to evaluate as valid, it is important to insert more permissive validators later in the _one_of iterator (or validator keyword). For example, having a variant with all fields defined as optional (ie: with missing=drop) inserted as first item in _one_of will make it always succeed regardless of following variants (since an empty schema with everything dropped is valid for optional-only elements). This would have as side effect of potentially failing the validation if other object are also valid depending on the received schema because the schema cannot be discriminated between many. If this occurs, it means the your schemas are too permissive.

In the event that you have very similar schemas that can sometime match except one identifier (e.g.: field type defining the type of object), consider adding a validator to each sub-node with explicit values to solve the discrimination problem.

As a shortcut, the OpenAPI keyword discriminator can be provided to try matching as a last resort.

For example:

class Animal(ExtendedMappingSchema):
    name = ExtendedSchemaNode(String())
    type = ExtendedSchemaNode(String())  # with explicit definition, this shouldn't be here

    ## With explicit definitions, each below 'Animal' class should be defined as follows
    ## type = ExtendedSchemaNode(String(), validator=colander.OneOf(['<animal>']))

class Cat(Animal):
    [...]   # many **OPTIONAL** fields

class Dog(Animal):
    [...]   # many **OPTIONAL** fields

# With the discriminator keyword, following is possible
class SomeAnimal(OneOfMappingSchema):
    discriminator = {
        "propertyName": "type",     # correspond to 'type' of 'Animal'
        "mapping": {
            "cat": Cat, "dog": Dog  # map expected values to target schemas
        }
    }
    _one_of = [
        Cat(),
        Dog(),
    ]

Note

Keyword discriminator supports a map of key-string to schemas-type as presented in the example, and the key must be located at the top level of the mapping. If only discriminator = "<field>" is provided, the definition will be created automatically using the example (which should be only the matching value) of the corresponding field of each node within the _one_of mapping.

When multiple valid schemas are matched against the input data, the error will be raised and returned with corresponding erroneous elements for each sub-schema (fully listed).

See also

  • AllOfKeywordSchema

  • AnyOfKeywordSchema

  • NotKeywordSchema

_one_of[source]
class weaver.wps_restapi.swagger_definitions.JobOutput(*args, **kwargs)[source]

Allows specifying all the required partial mapping schemas for an underlying complete schema definition. Corresponds to the allOf specifier of OpenAPI specification.

Example:

class RequiredItem(ExtendedMappingSchema):
    item = ExtendedSchemaNode(String())

class RequiredType(ExtendedMappingSchema):
    type = ExtendedSchemaNode(String())

class AllRequired(AnyKeywordSchema):
    _all_of = [RequiredItem(), RequiredType()]

Value parsed with schema this definition will be valid only when every since one of the sub-schemas is valid. Any sub-schema raising an invalid error for any reason with make the whole schema validation fail.

See also

  • OneOfKeywordSchema

  • AnyOfKeywordSchema

  • NotKeywordSchema

_all_of[source]
class weaver.wps_restapi.swagger_definitions.JobOutputList(*args, **kwargs)[source]

Combines DefaultSequenceSchema and DefaultSequenceSchema extensions so that default keyword is used first to resolve a missing sequence during deserialize() call, and then removes the node completely if no default was provided.

See also

  • ExtendedSchemaNode

  • ExtendedMappingSchema

title = JobOutputList[source]
output[source]
class weaver.wps_restapi.swagger_definitions.ResultLiteral(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

class weaver.wps_restapi.swagger_definitions.ResultLiteralList(*args, **kwargs)[source]

Combines DefaultSequenceSchema and DefaultSequenceSchema extensions so that default keyword is used first to resolve a missing sequence during deserialize() call, and then removes the node completely if no default was provided.

See also

  • ExtendedSchemaNode

  • ExtendedMappingSchema

result[source]
class weaver.wps_restapi.swagger_definitions.ValueFormatted(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

value[source]
format[source]
class weaver.wps_restapi.swagger_definitions.ValueFormattedList(*args, **kwargs)[source]

Combines DefaultSequenceSchema and DefaultSequenceSchema extensions so that default keyword is used first to resolve a missing sequence during deserialize() call, and then removes the node completely if no default was provided.

See also

  • ExtendedSchemaNode

  • ExtendedMappingSchema

result[source]
class weaver.wps_restapi.swagger_definitions.ResultReference(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

href[source]
format[source]
class weaver.wps_restapi.swagger_definitions.ResultReferenceList(*args, **kwargs)[source]

Combines DefaultSequenceSchema and DefaultSequenceSchema extensions so that default keyword is used first to resolve a missing sequence during deserialize() call, and then removes the node completely if no default was provided.

See also

  • ExtendedSchemaNode

  • ExtendedMappingSchema

result[source]
class weaver.wps_restapi.swagger_definitions.ResultData(*args, **kwargs)[source]

Allows specifying multiple supported mapping schemas variants for an underlying schema definition. Corresponds to the oneOf specifier of OpenAPI specification.

Example:

class Variant1(MappingSchema):
    [...fields of Variant1...]

class Variant2(MappingSchema):
    [...fields of Variant2...]

class RequiredByBoth(MappingSchema):
    [...fields required by both Variant1 and Variant2...]

class OneOfWithRequiredFields(OneOfKeywordSchema, RequiredByBoth):
    _one_of = (Variant1, Variant2)
    [...alternatively, field required by all variants here...]

In the above example, the validation (ie: deserialize) process will succeed if only one of the _one_of variants’ validator completely succeed, and will fail if every variant fails validation execution. The operation will also fail if more than one validation succeeds.

Note

Class OneOfWithRequiredFields in the example is a shortcut variant to generate a specification that represents the pseudo-code oneOf([<list-of-objects-with-same-base>]).

The real OpenAPI method to implement the above very commonly occurring situation is as presented by the following pseudo-code:

oneOf[allOf[RequiredByBoth, Variant1], allOf[RequiredByBoth, Variant2]]

This is both painful to read and is a lot of extra code to write when you actually expand it all into classes (each oneOf/allOf is another class). Class OneOfKeywordSchema will actually simplify this by automatically making the allOf definitions for you if it detects other schema nodes than oneOf specified in the class bases. You can still do the full oneOf/allOf classes expansion manually though, it will result into the same specification.

Warning

When oneOf/allOf automatic expansion occurs during schema generation

Warning

When calling deserialize(), because the validation process requires exactly one of the variants to succeed to consider the whole object to evaluate as valid, it is important to insert more permissive validators later in the _one_of iterator (or validator keyword). For example, having a variant with all fields defined as optional (ie: with missing=drop) inserted as first item in _one_of will make it always succeed regardless of following variants (since an empty schema with everything dropped is valid for optional-only elements). This would have as side effect of potentially failing the validation if other object are also valid depending on the received schema because the schema cannot be discriminated between many. If this occurs, it means the your schemas are too permissive.

In the event that you have very similar schemas that can sometime match except one identifier (e.g.: field type defining the type of object), consider adding a validator to each sub-node with explicit values to solve the discrimination problem.

As a shortcut, the OpenAPI keyword discriminator can be provided to try matching as a last resort.

For example:

class Animal(ExtendedMappingSchema):
    name = ExtendedSchemaNode(String())
    type = ExtendedSchemaNode(String())  # with explicit definition, this shouldn't be here

    ## With explicit definitions, each below 'Animal' class should be defined as follows
    ## type = ExtendedSchemaNode(String(), validator=colander.OneOf(['<animal>']))

class Cat(Animal):
    [...]   # many **OPTIONAL** fields

class Dog(Animal):
    [...]   # many **OPTIONAL** fields

# With the discriminator keyword, following is possible
class SomeAnimal(OneOfMappingSchema):
    discriminator = {
        "propertyName": "type",     # correspond to 'type' of 'Animal'
        "mapping": {
            "cat": Cat, "dog": Dog  # map expected values to target schemas
        }
    }
    _one_of = [
        Cat(),
        Dog(),
    ]

Note

Keyword discriminator supports a map of key-string to schemas-type as presented in the example, and the key must be located at the top level of the mapping. If only discriminator = "<field>" is provided, the definition will be created automatically using the example (which should be only the matching value) of the corresponding field of each node within the _one_of mapping.

When multiple valid schemas are matched against the input data, the error will be raised and returned with corresponding erroneous elements for each sub-schema (fully listed).

See also

  • AllOfKeywordSchema

  • AnyOfKeywordSchema

  • NotKeywordSchema

schema_ref[source]
_one_of[source]
class weaver.wps_restapi.swagger_definitions.Result(*args, **kwargs)[source]

Result outputs obtained from a successful process job execution.

example_ref[source]
output_id[source]
class weaver.wps_restapi.swagger_definitions.JobInputsSchema(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

inputs[source]
class weaver.wps_restapi.swagger_definitions.JobOutputsSchema(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

outputs[source]
class weaver.wps_restapi.swagger_definitions.JobException(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

Code[source]
Locator[source]
Text[source]
class weaver.wps_restapi.swagger_definitions.JobExceptionsSchema(*args, **kwargs)[source]

Combines DefaultSequenceSchema and DefaultSequenceSchema extensions so that default keyword is used first to resolve a missing sequence during deserialize() call, and then removes the node completely if no default was provided.

See also

  • ExtendedSchemaNode

  • ExtendedMappingSchema

exceptions[source]
class weaver.wps_restapi.swagger_definitions.JobLogsSchema(*args, **kwargs)[source]

Combines DefaultSequenceSchema and DefaultSequenceSchema extensions so that default keyword is used first to resolve a missing sequence during deserialize() call, and then removes the node completely if no default was provided.

See also

  • ExtendedSchemaNode

  • ExtendedMappingSchema

log[source]
class weaver.wps_restapi.swagger_definitions.FrontpageParameterSchema(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

name[source]
enabled[source]
url[source]
doc[source]
class weaver.wps_restapi.swagger_definitions.FrontpageParameters(*args, **kwargs)[source]

Combines DefaultSequenceSchema and DefaultSequenceSchema extensions so that default keyword is used first to resolve a missing sequence during deserialize() call, and then removes the node completely if no default was provided.

See also

  • ExtendedSchemaNode

  • ExtendedMappingSchema

parameter[source]
class weaver.wps_restapi.swagger_definitions.FrontpageSchema(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

message[source]
configuration[source]
parameters[source]
class weaver.wps_restapi.swagger_definitions.SwaggerJSONSpecSchema(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

class weaver.wps_restapi.swagger_definitions.SwaggerUISpecSchema(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

class weaver.wps_restapi.swagger_definitions.VersionsSpecSchema(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

name[source]
type[source]
version[source]
class weaver.wps_restapi.swagger_definitions.VersionsList(*args, **kwargs)[source]

Combines DefaultSequenceSchema and DefaultSequenceSchema extensions so that default keyword is used first to resolve a missing sequence during deserialize() call, and then removes the node completely if no default was provided.

See also

  • ExtendedSchemaNode

  • ExtendedMappingSchema

version[source]
class weaver.wps_restapi.swagger_definitions.VersionsSchema(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

versions[source]
class weaver.wps_restapi.swagger_definitions.ConformanceList(*args, **kwargs)[source]

Combines DefaultSequenceSchema and DefaultSequenceSchema extensions so that default keyword is used first to resolve a missing sequence during deserialize() call, and then removes the node completely if no default was provided.

See also

  • ExtendedSchemaNode

  • ExtendedMappingSchema

conformance[source]
class weaver.wps_restapi.swagger_definitions.ConformanceSchema(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

conformsTo[source]
class weaver.wps_restapi.swagger_definitions.PackageBody(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

class weaver.wps_restapi.swagger_definitions.ExecutionUnit(*args, **kwargs)[source]

Allows specifying multiple supported mapping schemas variants for an underlying schema definition. Corresponds to the oneOf specifier of OpenAPI specification.

Example:

class Variant1(MappingSchema):
    [...fields of Variant1...]

class Variant2(MappingSchema):
    [...fields of Variant2...]

class RequiredByBoth(MappingSchema):
    [...fields required by both Variant1 and Variant2...]

class OneOfWithRequiredFields(OneOfKeywordSchema, RequiredByBoth):
    _one_of = (Variant1, Variant2)
    [...alternatively, field required by all variants here...]

In the above example, the validation (ie: deserialize) process will succeed if only one of the _one_of variants’ validator completely succeed, and will fail if every variant fails validation execution. The operation will also fail if more than one validation succeeds.

Note

Class OneOfWithRequiredFields in the example is a shortcut variant to generate a specification that represents the pseudo-code oneOf([<list-of-objects-with-same-base>]).

The real OpenAPI method to implement the above very commonly occurring situation is as presented by the following pseudo-code:

oneOf[allOf[RequiredByBoth, Variant1], allOf[RequiredByBoth, Variant2]]

This is both painful to read and is a lot of extra code to write when you actually expand it all into classes (each oneOf/allOf is another class). Class OneOfKeywordSchema will actually simplify this by automatically making the allOf definitions for you if it detects other schema nodes than oneOf specified in the class bases. You can still do the full oneOf/allOf classes expansion manually though, it will result into the same specification.

Warning

When oneOf/allOf automatic expansion occurs during schema generation

Warning

When calling deserialize(), because the validation process requires exactly one of the variants to succeed to consider the whole object to evaluate as valid, it is important to insert more permissive validators later in the _one_of iterator (or validator keyword). For example, having a variant with all fields defined as optional (ie: with missing=drop) inserted as first item in _one_of will make it always succeed regardless of following variants (since an empty schema with everything dropped is valid for optional-only elements). This would have as side effect of potentially failing the validation if other object are also valid depending on the received schema because the schema cannot be discriminated between many. If this occurs, it means the your schemas are too permissive.

In the event that you have very similar schemas that can sometime match except one identifier (e.g.: field type defining the type of object), consider adding a validator to each sub-node with explicit values to solve the discrimination problem.

As a shortcut, the OpenAPI keyword discriminator can be provided to try matching as a last resort.

For example:

class Animal(ExtendedMappingSchema):
    name = ExtendedSchemaNode(String())
    type = ExtendedSchemaNode(String())  # with explicit definition, this shouldn't be here

    ## With explicit definitions, each below 'Animal' class should be defined as follows
    ## type = ExtendedSchemaNode(String(), validator=colander.OneOf(['<animal>']))

class Cat(Animal):
    [...]   # many **OPTIONAL** fields

class Dog(Animal):
    [...]   # many **OPTIONAL** fields

# With the discriminator keyword, following is possible
class SomeAnimal(OneOfMappingSchema):
    discriminator = {
        "propertyName": "type",     # correspond to 'type' of 'Animal'
        "mapping": {
            "cat": Cat, "dog": Dog  # map expected values to target schemas
        }
    }
    _one_of = [
        Cat(),
        Dog(),
    ]

Note

Keyword discriminator supports a map of key-string to schemas-type as presented in the example, and the key must be located at the top level of the mapping. If only discriminator = "<field>" is provided, the definition will be created automatically using the example (which should be only the matching value) of the corresponding field of each node within the _one_of mapping.

When multiple valid schemas are matched against the input data, the error will be raised and returned with corresponding erroneous elements for each sub-schema (fully listed).

See also

  • AllOfKeywordSchema

  • AnyOfKeywordSchema

  • NotKeywordSchema

_one_of[source]
class weaver.wps_restapi.swagger_definitions.ExecutionUnitList(*args, **kwargs)[source]

Combines DefaultSequenceSchema and DefaultSequenceSchema extensions so that default keyword is used first to resolve a missing sequence during deserialize() call, and then removes the node completely if no default was provided.

See also

  • ExtendedSchemaNode

  • ExtendedMappingSchema

unit[source]
class weaver.wps_restapi.swagger_definitions.ProcessOfferingBase(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

process[source]
processVersion[source]
jobControlOptions[source]
outputTransmission[source]
class weaver.wps_restapi.swagger_definitions.ProcessOffering(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

process[source]
class weaver.wps_restapi.swagger_definitions.ProcessDeploymentOffering(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

process[source]
class weaver.wps_restapi.swagger_definitions.ProcessDescriptionChoiceType(*args, **kwargs)[source]

Allows specifying multiple supported mapping schemas variants for an underlying schema definition. Corresponds to the oneOf specifier of OpenAPI specification.

Example:

class Variant1(MappingSchema):
    [...fields of Variant1...]

class Variant2(MappingSchema):
    [...fields of Variant2...]

class RequiredByBoth(MappingSchema):
    [...fields required by both Variant1 and Variant2...]

class OneOfWithRequiredFields(OneOfKeywordSchema, RequiredByBoth):
    _one_of = (Variant1, Variant2)
    [...alternatively, field required by all variants here...]

In the above example, the validation (ie: deserialize) process will succeed if only one of the _one_of variants’ validator completely succeed, and will fail if every variant fails validation execution. The operation will also fail if more than one validation succeeds.

Note

Class OneOfWithRequiredFields in the example is a shortcut variant to generate a specification that represents the pseudo-code oneOf([<list-of-objects-with-same-base>]).

The real OpenAPI method to implement the above very commonly occurring situation is as presented by the following pseudo-code:

oneOf[allOf[RequiredByBoth, Variant1], allOf[RequiredByBoth, Variant2]]

This is both painful to read and is a lot of extra code to write when you actually expand it all into classes (each oneOf/allOf is another class). Class OneOfKeywordSchema will actually simplify this by automatically making the allOf definitions for you if it detects other schema nodes than oneOf specified in the class bases. You can still do the full oneOf/allOf classes expansion manually though, it will result into the same specification.

Warning

When oneOf/allOf automatic expansion occurs during schema generation

Warning

When calling deserialize(), because the validation process requires exactly one of the variants to succeed to consider the whole object to evaluate as valid, it is important to insert more permissive validators later in the _one_of iterator (or validator keyword). For example, having a variant with all fields defined as optional (ie: with missing=drop) inserted as first item in _one_of will make it always succeed regardless of following variants (since an empty schema with everything dropped is valid for optional-only elements). This would have as side effect of potentially failing the validation if other object are also valid depending on the received schema because the schema cannot be discriminated between many. If this occurs, it means the your schemas are too permissive.

In the event that you have very similar schemas that can sometime match except one identifier (e.g.: field type defining the type of object), consider adding a validator to each sub-node with explicit values to solve the discrimination problem.

As a shortcut, the OpenAPI keyword discriminator can be provided to try matching as a last resort.

For example:

class Animal(ExtendedMappingSchema):
    name = ExtendedSchemaNode(String())
    type = ExtendedSchemaNode(String())  # with explicit definition, this shouldn't be here

    ## With explicit definitions, each below 'Animal' class should be defined as follows
    ## type = ExtendedSchemaNode(String(), validator=colander.OneOf(['<animal>']))

class Cat(Animal):
    [...]   # many **OPTIONAL** fields

class Dog(Animal):
    [...]   # many **OPTIONAL** fields

# With the discriminator keyword, following is possible
class SomeAnimal(OneOfMappingSchema):
    discriminator = {
        "propertyName": "type",     # correspond to 'type' of 'Animal'
        "mapping": {
            "cat": Cat, "dog": Dog  # map expected values to target schemas
        }
    }
    _one_of = [
        Cat(),
        Dog(),
    ]

Note

Keyword discriminator supports a map of key-string to schemas-type as presented in the example, and the key must be located at the top level of the mapping. If only discriminator = "<field>" is provided, the definition will be created automatically using the example (which should be only the matching value) of the corresponding field of each node within the _one_of mapping.

When multiple valid schemas are matched against the input data, the error will be raised and returned with corresponding erroneous elements for each sub-schema (fully listed).

See also

  • AllOfKeywordSchema

  • AnyOfKeywordSchema

  • NotKeywordSchema

_one_of[source]
class weaver.wps_restapi.swagger_definitions.Deploy(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

processDescription[source]
immediateDeployment[source]
executionUnit[source]
deploymentProfileName[source]
owsContext[source]
class weaver.wps_restapi.swagger_definitions.PostProcessesEndpoint(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

header[source]
body[source]
class weaver.wps_restapi.swagger_definitions.PostProcessJobsEndpoint(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

header[source]
body[source]
class weaver.wps_restapi.swagger_definitions.GetJobsQueries(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

detail[source]
groups[source]
page[source]
limit[source]
datetime[source]
status[source]
process[source]
provider[source]
sort[source]
access[source]
notification_email[source]
tags[source]
class weaver.wps_restapi.swagger_definitions.GetJobsRequest(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

header[source]
querystring[source]
class weaver.wps_restapi.swagger_definitions.GetJobsEndpoint(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

class weaver.wps_restapi.swagger_definitions.GetProcessJobsEndpoint(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

class weaver.wps_restapi.swagger_definitions.GetProviderJobsEndpoint(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

class weaver.wps_restapi.swagger_definitions.GetProcessJobEndpoint(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

header[source]
class weaver.wps_restapi.swagger_definitions.DeleteProcessJobEndpoint(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

header[source]
class weaver.wps_restapi.swagger_definitions.BillsEndpoint(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

header[source]
class weaver.wps_restapi.swagger_definitions.BillEndpoint(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

header[source]
class weaver.wps_restapi.swagger_definitions.ProcessQuotesEndpoint(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

header[source]
class weaver.wps_restapi.swagger_definitions.ProcessQuoteEndpoint(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

header[source]
class weaver.wps_restapi.swagger_definitions.GetQuotesQueries(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

page[source]
limit[source]
process[source]
sort[source]
class weaver.wps_restapi.swagger_definitions.QuotesEndpoint(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

header[source]
querystring[source]
class weaver.wps_restapi.swagger_definitions.QuoteEndpoint(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

header[source]
class weaver.wps_restapi.swagger_definitions.PostProcessQuote(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

header[source]
body[source]
class weaver.wps_restapi.swagger_definitions.PostQuote(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

header[source]
body[source]
class weaver.wps_restapi.swagger_definitions.PostProcessQuoteRequestEndpoint(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

header[source]
body[source]
class weaver.wps_restapi.swagger_definitions.GetProviders(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

header[source]
class weaver.wps_restapi.swagger_definitions.PostProvider(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

header[source]
body[source]
class weaver.wps_restapi.swagger_definitions.GetProviderProcesses(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

header[source]
class weaver.wps_restapi.swagger_definitions.GetProviderProcess(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

header[source]
class weaver.wps_restapi.swagger_definitions.PostProviderProcessJobRequest(*args, **kwargs)[source]

Launching a new process request definition.

header[source]
querystring[source]
body[source]
class weaver.wps_restapi.swagger_definitions.ErrorDetail(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

code[source]
status[source]
class weaver.wps_restapi.swagger_definitions.OWSErrorCode(*args, **kwargs)[source]

Combines all colander.SchemaNode extensions so that default keyword is used first to resolve a missing field value during deserialize() call, and then removes the node completely if no default was provided, and evaluate variables as needed.

See also

  • ExtendedMappingSchema

  • ExtendedSequenceSchema

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

schema_type[source]
example = InvalidParameterValue[source]
description = OWS error code.[source]
class weaver.wps_restapi.swagger_definitions.OWSExceptionResponse(*args, **kwargs)[source]

Error content in XML format

description = OWS formatted exception.[source]
code[source]
locator[source]
message[source]
class weaver.wps_restapi.swagger_definitions.ErrorJsonResponseBodySchema(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

code[source]
description[source]
error[source]
exception[source]
class weaver.wps_restapi.swagger_definitions.UnprocessableEntityResponseSchema(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

description = Wrong format of given parameters.[source]
header[source]
body[source]
class weaver.wps_restapi.swagger_definitions.ForbiddenProcessAccessResponseSchema(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

description = Referenced process is not accessible.[source]
header[source]
body[source]
class weaver.wps_restapi.swagger_definitions.ForbiddenProviderAccessResponseSchema(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

description = Referenced provider is not accessible.[source]
header[source]
body[source]
class weaver.wps_restapi.swagger_definitions.InternalServerErrorResponseSchema(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

description = Unhandled internal server error.[source]
header[source]
body[source]
class weaver.wps_restapi.swagger_definitions.OkGetFrontpageResponse(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

header[source]
body[source]
class weaver.wps_restapi.swagger_definitions.OkGetSwaggerJSONResponse(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

header[source]
body[source]
class weaver.wps_restapi.swagger_definitions.OkGetSwaggerUIResponse(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

header[source]
body[source]
class weaver.wps_restapi.swagger_definitions.OkGetRedocUIResponse(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

header[source]
body[source]
class weaver.wps_restapi.swagger_definitions.OkGetVersionsResponse(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

header[source]
body[source]
class weaver.wps_restapi.swagger_definitions.OkGetConformanceResponse(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

header[source]
body[source]
class weaver.wps_restapi.swagger_definitions.OkGetProvidersListResponse(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

header[source]
body[source]
class weaver.wps_restapi.swagger_definitions.OkGetProviderCapabilitiesSchema(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

header[source]
body[source]
class weaver.wps_restapi.swagger_definitions.NoContentDeleteProviderSchema(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

header[source]
body[source]
class weaver.wps_restapi.swagger_definitions.NotImplementedDeleteProviderResponse(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

description = Provider removal not supported using referenced storage.[source]
class weaver.wps_restapi.swagger_definitions.OkGetProviderProcessesSchema(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

header[source]
body[source]
class weaver.wps_restapi.swagger_definitions.GetProcessesQuery(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

providers[source]
detail[source]
class weaver.wps_restapi.swagger_definitions.GetProcessesEndpoint(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

querystring[source]
class weaver.wps_restapi.swagger_definitions.OkGetProcessesListResponse(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

header[source]
body[source]
class weaver.wps_restapi.swagger_definitions.OkPostProcessDeployBodySchema(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

deploymentDone[source]
processSummary[source]
failureReason[source]
class weaver.wps_restapi.swagger_definitions.OkPostProcessesResponse(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

header[source]
body[source]
class weaver.wps_restapi.swagger_definitions.BadRequestGetProcessInfoResponse(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

description = Missing process identifier.[source]
body[source]
class weaver.wps_restapi.swagger_definitions.OkGetProcessInfoResponse(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

header[source]
body[source]
class weaver.wps_restapi.swagger_definitions.OkGetProcessPackageSchema(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

header[source]
body[source]
class weaver.wps_restapi.swagger_definitions.OkGetProcessPayloadSchema(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

header[source]
body[source]
class weaver.wps_restapi.swagger_definitions.ProcessVisibilityResponseBodySchema(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

value[source]
class weaver.wps_restapi.swagger_definitions.OkGetProcessVisibilitySchema(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

header[source]
body[source]
class weaver.wps_restapi.swagger_definitions.OkPutProcessVisibilitySchema(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

header[source]
body[source]
class weaver.wps_restapi.swagger_definitions.ForbiddenVisibilityUpdateResponseSchema(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

description = Visibility value modification not allowed.[source]
header[source]
body[source]
class weaver.wps_restapi.swagger_definitions.OkDeleteProcessUndeployBodySchema(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

deploymentDone[source]
identifier[source]
failureReason[source]
class weaver.wps_restapi.swagger_definitions.OkDeleteProcessResponse(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

header[source]
body[source]
class weaver.wps_restapi.swagger_definitions.OkGetProviderProcessDescriptionResponse(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

header[source]
body[source]
class weaver.wps_restapi.swagger_definitions.CreatedPostProvider(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

header[source]
body[source]
class weaver.wps_restapi.swagger_definitions.NotImplementedPostProviderResponse(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

description = Provider registration not supported using referenced storage.[source]
class weaver.wps_restapi.swagger_definitions.CreatedLaunchJobResponse(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

header[source]
body[source]
class weaver.wps_restapi.swagger_definitions.OkGetProcessJobResponse(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

header[source]
body[source]
class weaver.wps_restapi.swagger_definitions.OkDeleteProcessJobResponse(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

header[source]
body[source]
class weaver.wps_restapi.swagger_definitions.OkGetQueriedJobsResponse(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

header[source]
body[source]
class weaver.wps_restapi.swagger_definitions.OkDismissJobResponse(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

header[source]
body[source]
class weaver.wps_restapi.swagger_definitions.OkGetJobStatusResponse(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

header[source]
body[source]
class weaver.wps_restapi.swagger_definitions.NotFoundJobResponseSchema(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

description = Job reference UUID cannot be found.[source]
examples[source]
header[source]
body[source]
class weaver.wps_restapi.swagger_definitions.OkGetJobInputsResponse(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

header[source]
body[source]
class weaver.wps_restapi.swagger_definitions.OkGetJobOutputsResponse(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

header[source]
body[source]
class weaver.wps_restapi.swagger_definitions.RedirectResultResponse(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

header[source]
class weaver.wps_restapi.swagger_definitions.OkGetJobResultsResponse(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

header[source]
body[source]
class weaver.wps_restapi.swagger_definitions.CreatedQuoteExecuteResponse(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

header[source]
body[source]
class weaver.wps_restapi.swagger_definitions.CreatedQuoteRequestResponse(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

header[source]
body[source]
class weaver.wps_restapi.swagger_definitions.OkGetQuoteInfoResponse(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

header[source]
body[source]
class weaver.wps_restapi.swagger_definitions.OkGetQuoteListResponse(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

header[source]
body[source]
class weaver.wps_restapi.swagger_definitions.OkGetBillDetailResponse(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

header[source]
body[source]
class weaver.wps_restapi.swagger_definitions.OkGetBillListResponse(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

header[source]
body[source]
class weaver.wps_restapi.swagger_definitions.OkGetJobExceptionsResponse(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

header[source]
body[source]
class weaver.wps_restapi.swagger_definitions.OkGetJobLogsResponse(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • PermissiveMappingSchema

header[source]
body[source]
weaver.wps_restapi.swagger_definitions.get_api_frontpage_responses[source]
weaver.wps_restapi.swagger_definitions.get_openapi_json_responses[source]
weaver.wps_restapi.swagger_definitions.get_api_swagger_ui_responses[source]
weaver.wps_restapi.swagger_definitions.get_api_redoc_ui_responses[source]
weaver.wps_restapi.swagger_definitions.get_api_versions_responses[source]
weaver.wps_restapi.swagger_definitions.get_api_conformance_responses[source]
weaver.wps_restapi.swagger_definitions.get_processes_responses[source]
weaver.wps_restapi.swagger_definitions.post_processes_responses[source]
weaver.wps_restapi.swagger_definitions.get_process_responses[source]
weaver.wps_restapi.swagger_definitions.get_process_package_responses[source]
weaver.wps_restapi.swagger_definitions.get_process_payload_responses[source]
weaver.wps_restapi.swagger_definitions.get_process_visibility_responses[source]
weaver.wps_restapi.swagger_definitions.put_process_visibility_responses[source]
weaver.wps_restapi.swagger_definitions.delete_process_responses[source]
weaver.wps_restapi.swagger_definitions.get_providers_list_responses[source]
weaver.wps_restapi.swagger_definitions.get_provider_responses[source]
weaver.wps_restapi.swagger_definitions.delete_provider_responses[source]
weaver.wps_restapi.swagger_definitions.get_provider_processes_responses[source]
weaver.wps_restapi.swagger_definitions.get_provider_process_responses[source]
weaver.wps_restapi.swagger_definitions.post_provider_responses[source]
weaver.wps_restapi.swagger_definitions.post_provider_process_job_responses[source]
weaver.wps_restapi.swagger_definitions.post_process_jobs_responses[source]
weaver.wps_restapi.swagger_definitions.get_all_jobs_responses[source]
weaver.wps_restapi.swagger_definitions.get_single_job_status_responses[source]
weaver.wps_restapi.swagger_definitions.delete_job_responses[source]
weaver.wps_restapi.swagger_definitions.get_job_inputs_responses[source]
weaver.wps_restapi.swagger_definitions.get_job_outputs_responses[source]
weaver.wps_restapi.swagger_definitions.get_result_redirect_responses[source]
weaver.wps_restapi.swagger_definitions.get_job_results_responses[source]
weaver.wps_restapi.swagger_definitions.get_exceptions_responses[source]
weaver.wps_restapi.swagger_definitions.get_logs_responses[source]
weaver.wps_restapi.swagger_definitions.get_quote_list_responses[source]
weaver.wps_restapi.swagger_definitions.get_quote_responses[source]
weaver.wps_restapi.swagger_definitions.post_quotes_responses[source]
weaver.wps_restapi.swagger_definitions.post_quote_responses[source]
weaver.wps_restapi.swagger_definitions.get_bill_list_responses[source]
weaver.wps_restapi.swagger_definitions.get_bill_responses[source]
weaver.wps_restapi.swagger_definitions.wps_responses[source]
weaver.wps_restapi.swagger_definitions.service_api_route_info(service_api: cornice.Service, settings: weaver.typedefs.SettingsType)ViewInfo[source]
weaver.wps_restapi.swagger_definitions.datetime_interval_parser(datetime_interval: str)weaver.typedefs.DatetimeIntervalType[source]

This function parses a given datetime or interval into a dictionary that will be easy for database process.

weaver.wps_restapi.utils
Module Contents
weaver.wps_restapi.utils.LOGGER[source]
weaver.wps_restapi.utils.wps_restapi_base_path(container: weaver.typedefs.AnySettingsContainer)str[source]
weaver.wps_restapi.utils.get_wps_restapi_base_url(container: weaver.typedefs.AnySettingsContainer)str[source]
Package Contents
weaver.wps_restapi.LOGGER[source]
weaver.wps_restapi.includeme(config)[source]
Submodules
weaver.app

Weaver Web Application (weaver-manager).

Module Contents
weaver.app.LOGGER[source]
weaver.app.main(global_config, **settings)[source]

Creates a Pyramid WSGI application for Weaver.

weaver.config
Module Contents
weaver.config.LOGGER[source]
weaver.config.WEAVER_CONFIGURATION_DEFAULT = DEFAULT[source]
weaver.config.WEAVER_CONFIGURATION_ADES = ADES[source]
weaver.config.WEAVER_CONFIGURATION_EMS = EMS[source]
weaver.config.WEAVER_CONFIGURATION_HYBRID = HYBRID[source]
weaver.config.WEAVER_CONFIGURATIONS[source]
weaver.config.WEAVER_CONFIGURATIONS_REMOTE[source]
weaver.config.WEAVER_DEFAULT_INI_CONFIG = weaver.ini[source]
weaver.config.WEAVER_DEFAULT_DATA_SOURCES_CONFIG = data_sources.yml[source]
weaver.config.WEAVER_DEFAULT_REQUEST_OPTIONS_CONFIG = request_options.yml[source]
weaver.config.WEAVER_DEFAULT_WPS_PROCESSES_CONFIG = wps_processes.yml[source]
weaver.config.WEAVER_DEFAULT_CONFIGS[source]
weaver.config.get_weaver_configuration(container: weaver.typedefs.AnySettingsContainer)str[source]

Obtains the defined operation configuration mode.

Returns

one value amongst weaver.config.WEAVER_CONFIGURATIONS.

weaver.config.get_weaver_config_file(file_path: str, default_config_file: str, generate_default_from_example: bool = True)str[source]

Validates that the specified configuration file can be found, or falls back to the default one.

Handles ‘relative’ paths for settings in WEAVER_DEFAULT_INI_CONFIG referring to other configuration files. Default file must be one of WEAVER_DEFAULT_CONFIGS.

If both the specified file and the default file cannot be found, default file under WEAVER_DEFAULT_INI_CONFIG is auto-generated from the corresponding .example file if generate_default_from_example is True. If it is False, an empty string is returned instead without generation since no existing file can be guaranteed, and it is up to the caller to handle this situation as it explicitly disabled generation.

Parameters
  • file_path – path to a configuration file (can be relative if resolvable or matching a default file name)

  • default_config_file – one of WEAVER_DEFAULT_CONFIGS.

  • generate_default_from_example – enable fallback copy of default configuration file from corresponding example.

Returns

absolute path of the resolved file.

weaver.config.includeme(config)[source]
weaver.datatype
Module Contents
weaver.datatype.LOGGER[source]
class weaver.datatype.Base[source]

Dictionary with extended attributes auto-getter/setter for convenience. Explicitly overridden getter/setter attributes are called instead of dict-key get/set-item to ensure corresponding checks and/or value adjustments are executed before applying it to the sub-dict.

Initialize self. See help(type(self)) for accurate signature.

property id(self)[source]
property uuid(self)[source]
abstract json(self)weaver.typedefs.JSON[source]

Obtain the JSON data representation for response body.

Note

This method implementation should validate the JSON schema against the API definition whenever applicable to ensure integrity between the represented data type and the expected API response.

abstract params(self)Dict[str, Any][source]

Obtain the internal data representation for storage.

Note

This method implementation should provide a JSON-serializable definition of all fields representing the object to store.

class weaver.datatype.Service(*args, **kwargs)[source]

Dictionary that contains OWS services. It always has url key.

Initialize self. See help(type(self)) for accurate signature.

property id(self)[source]
property url(self)[source]

Service URL.

property name(self)[source]

Service name.

property type(self)[source]

Service type.

property public(self)[source]

Flag if service has public access.

property auth(self)[source]

Authentication method: public, token, cert.

json(self)weaver.typedefs.JSON[source]

Obtain the JSON data representation for response body.

Note

This method implementation should validate the JSON schema against the API definition whenever applicable to ensure integrity between the represented data type and the expected API response.

params(self)[source]

Obtain the internal data representation for storage.

Note

This method implementation should provide a JSON-serializable definition of all fields representing the object to store.

summary(self: pyramid.request.Request, request)Optional[weaver.typedefs.JSON][source]
class weaver.datatype.Job(*args, **kwargs)[source]

Dictionary that contains OWS service jobs. It always has id and task_id keys.

Initialize self. See help(type(self)) for accurate signature.

inputs[source]
results[source]
exceptions[source]
logs[source]
tags[source]
_get_log_msg(self: Optional[str], msg: Optional[str] = None, status: Optional[weaver.typedefs.Number] = None, progress=None)str[source]
static _get_err_msg(error: owslib.wps.WPSException)str[source]
save_log(self, errors: Optional[Union[str, Exception, owslib.wps.WPSException, List[owslib.wps.WPSException]]] = None, logger: Optional[logging.Logger] = None, message: Optional[str] = None, level: int = INFO, status: Optional[str] = None, progress: Optional[weaver.typedefs.Number] = None)None[source]

Logs the specified error and/or message, and adds the log entry to the complete job log.

For each new log entry, additional Job properties are added according to Job._get_log_msg() and the format defined by get_job_log_msg().

Parameters
  • errors – An error message or a list of WPS exceptions from which to log and save generated message stack.

  • logger – An additional Logger for which to propagate logged messages on top saving them to the job.

  • message – Explicit string to be logged, otherwise use the current Job.status_message is used.

  • level – Logging level to apply to the logged message. This parameter is ignored if errors are logged.

  • status – Override status applied in the logged message entry, but does not set it to the job object. Uses the current :prop:`Job.status` value if not specified. Must be one of Weaver.status values.

  • progress – Override progress applied in the logged message entry, but does not set it to the job object. Uses the current :prop:`Job.progress` value if not specified.

Note

The job object is updated with the log but still requires to be pushed to database to actually persist it.

property id(self)str[source]

Job UUID to retrieve the details from storage.

property task_id(self)Optional[str][source]

Reference Task UUID attributed by the Celery worker that monitors and executes this job.

property wps_id(self)Optional[str][source]

Reference WPS Request/Response UUID attributed by the executed PyWPS process.

This UUID matches the status-location, log and output directory of the WPS process. This parameter is only available when the process is executed on this local instance.

property service(self)Optional[str][source]

Service identifier of the corresponding remote process.

See also

property process(self)Optional[str][source]

Process identifier of the corresponding remote process.

See also

_get_inputs(self)List[Optional[Dict[str, Any]]][source]
_set_inputs(self: List[Optional[Dict[str, Any]]], inputs)None[source]
property user_id(self)Optional[str][source]
property status(self)str[source]
property status_message(self)str[source]
property status_location(self)Optional[str][source]
property notification_email(self)Optional[str][source]
property accept_language(self)Optional[str][source]
property execute_async(self)bool[source]
property is_local(self)bool[source]
property is_workflow(self)bool[source]
property created(self)datetime.datetime[source]
property started(self)Optional[datetime.datetime][source]
property finished(self)Optional[datetime.datetime][source]
is_finished(self)bool[source]
mark_finished(self)None[source]
property duration(self)Optional[datetime.timedelta][source]
property duration_str(self)str[source]
property progress(self)weaver.typedefs.Number[source]
_get_results(self)List[Optional[Dict[str, Any]]][source]
_set_results(self: List[Optional[Dict[str, Any]]], results)None[source]
_get_exceptions(self)List[Optional[Dict[str, str]]][source]
_set_exceptions(self: List[Optional[Dict[str, str]]], exceptions)None[source]
_get_logs(self)List[Dict[str, str]][source]
_set_logs(self: List[Dict[str, str]], logs)None[source]
_get_tags(self)List[Optional[str]][source]
_set_tags(self: List[Optional[str]], tags)None[source]
property access(self)str[source]

Job visibility access from execution.

property request(self)Optional[str][source]

XML request for WPS execution submission as string (binary).

property response(self)Optional[str][source]

XML status response from WPS execution submission as string (binary).

_job_url(self, settings)[source]

Obtains the JSON links section of many response body for jobs.

If self_link is provided (e.g.: “outputs”) the link for that corresponding item will also be added as self entry to the links. It must be a recognized job link field.

Parameters
  • container – object that helps retrieve instance details, namely the host URL.

  • self_link – name of a section that represents the current link that will be returned.

json(self: Optional[weaver.typedefs.AnySettingsContainer], container: Optional[str] = None, self_link=None)weaver.typedefs.JSON[source]

Obtains the JSON data representation for response body.

Note

Settings are required to update API shortcut URLs to job additional information. Without them, paths will not include the API host, which will not resolve to full URI.

params(self)Dict[str, Any][source]

Obtain the internal data representation for storage.

Note

This method implementation should provide a JSON-serializable definition of all fields representing the object to store.

class weaver.datatype.Process(*args, **kwargs)[source]

Dictionary that contains a process description for db storage. It always has identifier and processEndpointWPS1 keys.

Initialize self. See help(type(self)) for accurate signature.

_character_codes = [['$', '$'], ['.', '.']][source]
property id(self)str[source]
property identifier(self)str[source]
property title(self)str[source]
property abstract(self)str[source]
property keywords(self)List[str][source]
property metadata(self)List[str][source]
property version(self)Optional[str][source]
property inputs(self)Optional[List[Dict[str, Any]]][source]
property outputs(self)Optional[List[Dict[str, Any]]][source]
property jobControlOptions(self)List[str][source]
property outputTransmission(self)List[str][source]
property processDescriptionURL(self)Optional[str][source]
property processEndpointWPS1(self)Optional[str][source]
property executeEndpoint(self)Optional[str][source]
property owsContext(self)Optional[weaver.typedefs.JSON][source]
property type(self)str[source]

Type of process amongst weaver.processes.types definitions.

property package(self)Optional[weaver.typedefs.CWL][source]

Package CWL definition as JSON.

property payload(self)weaver.typedefs.JSON[source]

Deployment specification as JSON body.

static _recursive_replace(pkg: weaver.typedefs.JSON, index_from: int, index_to: int)weaver.typedefs.JSON[source]
static _encode(obj: Optional[weaver.typedefs.JSON])Optional[weaver.typedefs.JSON][source]
static _decode(obj: Optional[weaver.typedefs.JSON])Optional[weaver.typedefs.JSON][source]
property visibility(self)str[source]
params(self)Dict[str, Any][source]

Obtain the internal data representation for storage.

Note

This method implementation should provide a JSON-serializable definition of all fields representing the object to store.

property params_wps(self)Dict[str, Any][source]

Values applicable to PyWPS Process __init__

json(self)weaver.typedefs.JSON[source]

Obtains the JSON serializable complete representation of the process.

offering(self)weaver.typedefs.JSON[source]

Obtains the JSON serializable offering representation of the process.

summary(self)weaver.typedefs.JSON[source]

Obtains the JSON serializable summary representation of the process.

static from_wps(wps_process: pywps.Process, **extra_params: Any)Process[source]

Converts a pywps Process into a weaver.datatype.Process using provided parameters.

static from_ows(process: owslib.wps.Process, service: Service, container: weaver.typedefs.AnySettingsContainer, **kwargs: Any)Process[source]

Converts a owslib.wps Process to local storage weaver.datatype.Process.

static convert(process: weaver.typedefs.AnyProcess, service: Optional[Service] = None, container: Optional[weaver.typedefs.AnySettingsContainer] = None, **kwargs: Any)Process[source]

Converts known process equivalents definitions into the formal datatype employed by Weaver.

wps(self)pywps.Process[source]

Converts this Process to a corresponding format understood by pywps.

class weaver.datatype.Quote(*args, **kwargs)[source]

Dictionary that contains quote information. It always has id and process keys.

Initialize self. See help(type(self)) for accurate signature.

property id(self)[source]

Quote ID.

property title(self)[source]

Quote title.

property description(self)[source]

Quote description.

property details(self)[source]

Quote details.

property user(self)[source]

User ID requesting the quote

property process(self)[source]

WPS Process ID.

property estimatedTime(self)[source]

Process estimated time.

property processParameters(self)[source]

Process execution parameters for quote.

property location(self)[source]

WPS Process URL.

property price(self)[source]

Price of the current quote

property currency(self)[source]

Currency of the quote price

property expire(self)[source]

Quote expiration datetime.

property created(self)[source]

Quote creation datetime.

property steps(self)[source]

Sub-quote IDs if applicable

params(self)Dict[str, Any][source]

Obtain the internal data representation for storage.

Note

This method implementation should provide a JSON-serializable definition of all fields representing the object to store.

json(self)weaver.typedefs.JSON[source]

Obtain the JSON data representation for response body.

Note

This method implementation should validate the JSON schema against the API definition whenever applicable to ensure integrity between the represented data type and the expected API response.

class weaver.datatype.Bill(*args, **kwargs)[source]

Dictionary that contains bill information. It always has id, user, quote and job keys.

Initialize self. See help(type(self)) for accurate signature.

property id(self)[source]

Bill ID.

property user(self)[source]

User ID

property quote(self)[source]

Quote ID.

property job(self)[source]

Job ID.

property price(self)[source]

Price of the current quote

property currency(self)[source]

Currency of the quote price

property created(self)[source]

Quote creation datetime.

property title(self)[source]

Quote title.

property description(self)[source]

Quote description.

params(self)Dict[str, Any][source]

Obtain the internal data representation for storage.

Note

This method implementation should provide a JSON-serializable definition of all fields representing the object to store.

json(self)weaver.typedefs.JSON[source]

Obtain the JSON data representation for response body.

Note

This method implementation should validate the JSON schema against the API definition whenever applicable to ensure integrity between the represented data type and the expected API response.

weaver.exceptions

Some of these error inherit from weaver.owsexceptions.OWSException and their derived classes to allow pywps to automatically understand and render those exception if raised by an underlying weaver operation.

Module Contents
weaver.exceptions.LOGGER[source]
exception weaver.exceptions.WeaverException[source]

Base class of exceptions defined by weaver package.

Initialize self. See help(type(self)) for accurate signature.

code = 500[source]
title = Internal Server Error[source]
exception weaver.exceptions.InvalidIdentifierValue[source]

Error indicating that an ID to be employed for following operations is not considered as valid to allow further processed or usage.

Initialize self. See help(type(self)) for accurate signature.

code = 400[source]
locator = identifier[source]
exception weaver.exceptions.MissingIdentifierValue[source]

Error indicating that an ID to be employed for following operations was missing and cannot continue further processing or usage.

Initialize self. See help(type(self)) for accurate signature.

code = 400[source]
locator = identifier[source]
exception weaver.exceptions.ServiceException[source]

Base exception related to a weaver.datatype.Service.

Initialize self. See help(type(self)) for accurate signature.

locator = service[source]
exception weaver.exceptions.ServiceNotAccessible[source]

Error indicating that a WPS service exists but is not visible to retrieve from the storage backend of an instance of weaver.store.ServiceStore.

Initialize self. See help(type(self)) for accurate signature.

exception weaver.exceptions.ServiceNotFound[source]

Error indicating that an OWS service could not be read from the storage backend by an instance of weaver.store.ServiceStore.

Initialize self. See help(type(self)) for accurate signature.

exception weaver.exceptions.ServiceRegistrationError[source]

Error indicating that an OWS service could not be registered in the storage backend by an instance of weaver.store.ServiceStore.

Initialize self. See help(type(self)) for accurate signature.

exception weaver.exceptions.ProcessException[source]

Base exception related to a weaver.datatype.Process.

Initialize self. See help(type(self)) for accurate signature.

locator = process[source]
exception weaver.exceptions.ProcessNotAccessible[source]

Error indicating that a local WPS process exists but is not visible to retrieve from the storage backend of an instance of weaver.store.ProcessStore.

Initialize self. See help(type(self)) for accurate signature.

exception weaver.exceptions.ProcessNotFound[source]

Error indicating that a local WPS process could not be read from the storage backend by an instance of weaver.store.ProcessStore.

Initialize self. See help(type(self)) for accurate signature.

exception weaver.exceptions.ProcessRegistrationError[source]

Error indicating that a WPS process could not be registered in the storage backend by an instance of weaver.store.ProcessStore.

Initialize self. See help(type(self)) for accurate signature.

exception weaver.exceptions.ProcessInstanceError[source]

Error indicating that the process instance passed is not supported with storage backend by an instance of weaver.store.ProcessStore.

Initialize self. See help(type(self)) for accurate signature.

exception weaver.exceptions.JobException[source]

Base exception related to a weaver.datatype.Job.

Initialize self. See help(type(self)) for accurate signature.

locator = job[source]
exception weaver.exceptions.JobNotFound[source]

Error indicating that a job could not be read from the storage backend by an instance of weaver.store.JobStore.

Initialize self. See help(type(self)) for accurate signature.

exception weaver.exceptions.JobRegistrationError[source]

Error indicating that a job could not be registered in the storage backend by an instance of weaver.store.JobStore.

Initialize self. See help(type(self)) for accurate signature.

exception weaver.exceptions.JobUpdateError[source]

Error indicating that a job could not be updated in the storage backend by an instance of weaver.store.JobStore.

Initialize self. See help(type(self)) for accurate signature.

exception weaver.exceptions.PackageException[source]

Base exception related to a weaver.processes.wps_package.Package.

Initialize self. See help(type(self)) for accurate signature.

locator = package[source]
exception weaver.exceptions.PackageTypeError[source]

Error indicating that an instance of weaver.processes.wps_package.WpsPackage could not properly parse input/output type(s) for package deployment or execution.

Initialize self. See help(type(self)) for accurate signature.

exception weaver.exceptions.PackageRegistrationError[source]

Error indicating that an instance of weaver.processes.wps_package.WpsPackage could not properly be registered for package deployment because of invalid prerequisite.

Initialize self. See help(type(self)) for accurate signature.

exception weaver.exceptions.PackageExecutionError[source]

Error indicating that an instance of weaver.processes.wps_package.WpsPackage could not properly execute the package using provided inputs and package definition.

Initialize self. See help(type(self)) for accurate signature.

exception weaver.exceptions.PackageNotFound[source]

Error indicating that an instance of weaver.processes.wps_package.WpsPackage could not properly retrieve the package definition using provided references.

Initialize self. See help(type(self)) for accurate signature.

exception weaver.exceptions.PayloadNotFound[source]

Error indicating that an instance of weaver.processes.wps_package.WpsPackage could not properly retrieve the package deploy payload using provided references.

Initialize self. See help(type(self)) for accurate signature.

exception weaver.exceptions.QuoteException[source]

Base exception related to a weaver.datatype.Quote.

Initialize self. See help(type(self)) for accurate signature.

locator = quote[source]
exception weaver.exceptions.QuoteNotFound[source]

Error indicating that a quote could not be read from the storage backend by an instance of weaver.store.QuoteStore.

Initialize self. See help(type(self)) for accurate signature.

exception weaver.exceptions.QuoteRegistrationError[source]

Error indicating that a quote could not be registered in the storage backend by an instance of weaver.store.QuoteStore.

Initialize self. See help(type(self)) for accurate signature.

exception weaver.exceptions.QuoteInstanceError[source]

Error indicating that a given object doesn’t correspond to an expected instance of weaver.datatype.Quote.

Initialize self. See help(type(self)) for accurate signature.

exception weaver.exceptions.BillException[source]

Base exception related to a weaver.datatype.Bill.

Initialize self. See help(type(self)) for accurate signature.

locator = bill[source]
exception weaver.exceptions.BillNotFound[source]

Error indicating that a bill could not be read from the storage backend by an instance of weaver.store.BillStore.

Initialize self. See help(type(self)) for accurate signature.

exception weaver.exceptions.BillRegistrationError[source]

Error indicating that a bill could not be registered in the storage backend by an instance of weaver.store.BillStore.

Initialize self. See help(type(self)) for accurate signature.

exception weaver.exceptions.BillInstanceError[source]

Error indicating that a given object doesn’t correspond to an expected instance of weaver.datatype.Bill.

Initialize self. See help(type(self)) for accurate signature.

weaver.exceptions.handle_known_exceptions(function: Callable[[Any, Any], Any])Callable[source]

Decorator that catches lower-level raised exception that are known to weaver but not by pywps.

See also

weaver.wps.service.WorkerService

Without prior handling of known internal exception, pywps generates by default 500 internal server error response since it doesn’t know how to interpret more specific exceptions defined in weaver.

The decorator simply returns the known exception such that weaver.tweens.ows_response_tween() can later handle it appropriately. Exceptions derived from :exception:`weaver.owsexceptions.OWSException` are employed since they themselves have base references to pywps.exceptions classes that the service can understand.

Warning

In pywps, HTTPException refers to :exception:`werkzeug.exceptions.HTTPException` while in weaver, it is :exception:`pyramid.httpexceptions.HTTPException`. They both offer similar interfaces and functionalities (headers, body, status-code, etc.), but they are not intercepted in the same try/except blocks.

weaver.exceptions.log_unhandled_exceptions(logger: logging.Logger = LOGGER, message: str = 'Unhandled exception occurred.', exception: Type[Exception] = Exception, force: bool = False, require_http: bool = True, is_request: bool = True)Callable[source]

Decorator that will raise exception with specified message if an exception is caught while execution the wrapped function, after logging relevant details about the caught exception with logger.

Parameters
  • logger – logger to use for logging (default: use weaver.exception.LOGGER).

  • message – message that will be logged with details and then raised with exception.

  • exception – exception type to be raised instead of the caught exception.

  • force – force handling of any raised exception (default: only known unhandled exceptions are logged).

  • require_http – consider non HTTP-like exceptions as unknown and raise one instead (default: True and raises HTTPInternalServerError, unless exception is HTTP-like).

  • is_request – specifies if the decorator is applied onto a registered request function to handle its inputs.

Raises
  • exception – if an unknown exception was caught (or forced) during the decorated function’s execution.

  • Exception – original exception if it is known.

weaver.execute
Module Contents
weaver.execute.EXECUTE_MODE_AUTO = auto[source]
weaver.execute.EXECUTE_MODE_ASYNC = async[source]
weaver.execute.EXECUTE_MODE_SYNC = sync[source]
weaver.execute.EXECUTE_MODE_OPTIONS[source]
weaver.execute.EXECUTE_CONTROL_OPTION_ASYNC = async-execute[source]
weaver.execute.EXECUTE_CONTROL_OPTION_SYNC = sync-execute[source]
weaver.execute.EXECUTE_CONTROL_OPTIONS[source]
weaver.execute.EXECUTE_RESPONSE_RAW = raw[source]
weaver.execute.EXECUTE_RESPONSE_DOCUMENT = document[source]
weaver.execute.EXECUTE_RESPONSE_OPTIONS[source]
weaver.execute.EXECUTE_TRANSMISSION_MODE_VALUE = value[source]
weaver.execute.EXECUTE_TRANSMISSION_MODE_REFERENCE = reference[source]
weaver.execute.EXECUTE_TRANSMISSION_MODE_OPTIONS[source]
weaver.formats
Module Contents
weaver.formats.ACCEPT_LANGUAGE_EN_CA = en-CA[source]
weaver.formats.ACCEPT_LANGUAGE_FR_CA = fr-CA[source]
weaver.formats.ACCEPT_LANGUAGE_EN_US = en-US[source]
weaver.formats.ACCEPT_LANGUAGES[source]
weaver.formats.CONTENT_TYPE_APP_CWL = application/x-cwl[source]
weaver.formats.CONTENT_TYPE_APP_FORM = application/x-www-form-urlencoded[source]
weaver.formats.CONTENT_TYPE_APP_NETCDF = application/x-netcdf[source]
weaver.formats.CONTENT_TYPE_APP_GZIP = application/gzip[source]
weaver.formats.CONTENT_TYPE_APP_HDF5 = application/x-hdf5[source]
weaver.formats.CONTENT_TYPE_APP_TAR = application/x-tar[source]
weaver.formats.CONTENT_TYPE_APP_TAR_GZ = application/tar+gzip[source]
weaver.formats.CONTENT_TYPE_APP_YAML = application/x-yaml[source]
weaver.formats.CONTENT_TYPE_APP_ZIP = application/zip[source]
weaver.formats.CONTENT_TYPE_TEXT_HTML = text/html[source]
weaver.formats.CONTENT_TYPE_TEXT_PLAIN = text/plain[source]
weaver.formats.CONTENT_TYPE_APP_PDF = application/pdf[source]
weaver.formats.CONTENT_TYPE_APP_JSON = application/json[source]
weaver.formats.CONTENT_TYPE_APP_GEOJSON = application/geo+json[source]
weaver.formats.CONTENT_TYPE_APP_VDN_GEOJSON = application/vnd.geo+json[source]
weaver.formats.CONTENT_TYPE_APP_XML = application/xml[source]
weaver.formats.CONTENT_TYPE_IMAGE_GEOTIFF = image/tiff; subtype=geotiff[source]
weaver.formats.CONTENT_TYPE_IMAGE_JPEG = image/jpeg[source]
weaver.formats.CONTENT_TYPE_IMAGE_PNG = image/png[source]
weaver.formats.CONTENT_TYPE_IMAGE_TIFF = image/tiff[source]
weaver.formats.CONTENT_TYPE_TEXT_XML = text/xml[source]
weaver.formats.CONTENT_TYPE_ANY_XML[source]
weaver.formats.CONTENT_TYPE_ANY = */*[source]
weaver.formats._CONTENT_TYPE_EXTENSION_MAPPING :Dict[str, str][source]
weaver.formats._CONTENT_TYPE_FORMAT_MAPPING :Dict[str, Format][source]
weaver.formats._CONTENT_TYPE_SYNONYM_MAPPING[source]
weaver.formats.IANA_NAMESPACE = iana[source]
weaver.formats.IANA_NAMESPACE_DEFINITION[source]
weaver.formats.EDAM_NAMESPACE = edam[source]
weaver.formats.EDAM_NAMESPACE_DEFINITION[source]
weaver.formats.EDAM_SCHEMA = http://edamontology.org/EDAM_1.24.owl[source]
weaver.formats.EDAM_MAPPING[source]
weaver.formats.FORMAT_NAMESPACES[source]
weaver.formats.WPS_VERSION_100 = 1.0.0[source]
weaver.formats.WPS_VERSION_200 = 2.0.0[source]
weaver.formats.OUTPUT_FORMAT_JSON = json[source]
weaver.formats.OUTPUT_FORMAT_XML = xml[source]
weaver.formats.OUTPUT_FORMATS[source]
weaver.formats.LOGGER[source]
weaver.formats.get_format(mime_type: str, default: Optional[str] = None)pywps.inout.formats.Format[source]

Obtains a Format with predefined extension and encoding details from known MIME-types.

weaver.formats.get_extension(mime_type: str)str[source]

Retrieves the extension corresponding to mime_type if explicitly defined, or by parsing it.

weaver.formats.get_cwl_file_format(mime_type: str, make_reference: bool = False, must_exist: bool = True, allow_synonym: bool = True)Union[Tuple[Optional[weaver.typedefs.JSON], Optional[str]], Optional[str]][source]

Obtains the corresponding IANA/EDAM format value to be applied under a CWL I/O File from the mime_type (Content-Type header) using the first matched one.

Lookup procedure is as follows:

  • If make_reference=False:
    • If there is a match, returns tuple({<namespace-name: namespace-url>}, <format>) with:
      1. corresponding namespace mapping to be applied under $namespaces in the CWL.

      2. value of format adjusted according to the namespace to be applied to File in the CWL.

    • If there is no match but must_exist=False, returns a literal and non-existing definition as tuple({"iana": <iana-url>}, <format>).

    • If there is no match but must_exist=True AND allow_synonym=True, retry the call with the synonym if available, or move to next step. Skip this step if allow_synonym=False.

    • Otherwise, returns (None, None)

  • If make_reference=True:
    • If there is a match, returns the explicit format reference as <namespace-url>/<format>.

    • If there is no match but must_exist=False, returns the literal reference as <iana-url>/<format> (N.B.: literal non-official MIME-type reference will be returned even if an official synonym exists).

    • If there is no match but must_exist=True AND allow_synonym=True, retry the call with the synonym if available, or move to next step. Skip this step if allow_synonym=False.

    • Returns a single None as there is not match (directly or synonym).

Note:

In situations where must_exist=False is used and that the namespace and/or full format URL cannot be resolved to an existing reference, CWL will raise a validation error as it cannot confirm the format. You must therefore make sure that the returned reference (or a synonym format) really exists when using must_exist=False before providing it to the CWL I/O definition. Setting must_exist=False should be used only for literal string comparison or pre-processing steps to evaluate formats.

Parameters
  • mime_type – Some reference, namespace’d or literal (possibly extended) MIME-type string.

  • make_reference – Construct the full URL reference to the resolved MIME-type. Otherwise return tuple details.

  • must_exist – Return result only if it can be resolved to an official MIME-type (or synonym if enabled), otherwise None. Non-official MIME-type can be enforced if disabled, in which case IANA namespace/URL is used as it preserves the original <type>/<subtype> format.

  • allow_synonym – Allow resolution of non-official MIME-type to an official MIME-type synonym if available. Types defined as synonym have semantically the same format validation/resolution for CWL. Requires must_exist=True, otherwise the non-official MIME-type is employed directly as result.

Returns

Resolved MIME-type format for CWL usage, accordingly to specified arguments (see description details).

weaver.formats.clean_mime_type_format(mime_type: str, suffix_subtype: bool = False, strip_parameters: bool = False)str[source]

Removes any additional namespace key or URL from mime_type so that it corresponds to the generic representation (e.g.: application/json) instead of the <namespace-name>:<format> mapping variant used in CWL->inputs/outputs->File->format or the complete URL reference.

According to provided arguments, it also cleans up additional parameters or extracts sub-type suffixes.

Parameters
  • mime_type – MIME-type, full URL to MIME-type or namespace-formatted string that must be cleaned up.

  • suffix_subtype – Remove additional sub-type specializations details separated by + symbol such that an explicit format like application/vnd.api+json returns only its most basic suffix format defined as``application/json``.

  • strip_parameters – Removes additional MIME-type parameters such that only the leading part defining the type/subtype are returned. For example, this will get rid of ; charset=UTF-8 or ; version=4.0 parameters.

Note

Parameters suffix_subtype and strip_parameters are not necessarily exclusive.

weaver.notify
Module Contents
weaver.notify.LOGGER[source]
weaver.notify.notify_job_complete(job: weaver.datatype.Job, to_email_recipient: str, container: weaver.typedefs.AnySettingsContainer)None[source]

Send email notification of a job completion.

weaver.notify.encrypt_email(email, settings)[source]
weaver.owsexceptions

Exceptions are based on pyramid.httpexceptions and pywps.exceptions to handle more cases where they can be caught whether the running process is via weaver or through pywps service.

Furthermore, interrelation with weaver.exceptions classes (with base :exception:`weaver.exceptions.WeaverException`) also employ specific :exception:`OWSExceptions` definitions to provide specific error details.

Module Contents
exception weaver.owsexceptions.OWSException(detail=None, value=None, **kw)[source]

Represents a WSGI response.

If no arguments are passed, creates a Response that uses a variety of defaults. The defaults may be changed by sub-classing the Response. See the sub-classing notes.

Variables
  • body (bytes or text_type) – If body is a text_type, then it will be encoded using either charset when provided or default_encoding when charset is not provided if the content_type allows for a charset. This argument is mutually exclusive with app_iter.

  • status (int or str) – Either an int or a string that is an integer followed by the status text. If it is an integer, it will be converted to a proper status that also includes the status text. Any existing status text will be kept. Non-standard values are allowed.

  • headerlist (list) – A list of HTTP headers for the response.

  • app_iter (iterable) – An iterator that is used as the body of the response. Should conform to the WSGI requirements and should provide bytes. This argument is mutually exclusive with body.

  • content_type (str or None) – Sets the Content-Type header. If no content_type is provided, and there is no headerlist, the default_content_type will be automatically set. If headerlist is provided then this value is ignored.

  • conditional_response (bool) – Used to change the behavior of the Response to check the original request for conditional response headers. See conditional_response_app() for more information.

  • charset (str or None) – Adds a charset Content-Type parameter. If no charset is provided and the Content-Type is text, then the default_charset will automatically be added. Currently the only Content-Type’s that allow for a charset are defined to be text/*, application/xml, and */*+xml. Any other Content-Type’s will not have a charset added. If a headerlist is provided this value is ignored.

All other response attributes may be set on the response by providing them as keyword arguments. A TypeError will be raised for any unexpected keywords.

Sub-classing notes:

  • The default_content_type is used as the default for the Content-Type header that is returned on the response. It is text/html.

  • The default_charset is used as the default character set to return on the Content-Type header, if the Content-Type allows for a charset parameter. Currently the only Content-Type’s that allow for a charset are defined to be: text/*, application/xml, and */*+xml. Any other Content-Type’s will not have a charset added.

  • The unicode_errors is set to strict, and access on a text will raise an error if it fails to decode the body.

  • default_conditional_response is set to False. This flag may be set to True so that all Response objects will attempt to check the original request for conditional response headers. See conditional_response_app() for more information.

  • default_body_encoding is set to ‘UTF-8’ by default. It exists to allow users to get/set the Response object using .text, even if no charset has been set for the Content-Type.

Initialize self. See help(type(self)) for accurate signature.

code = NoApplicableCode[source]
value[source]
locator = NoApplicableCode[source]
description = Unknown Error[source]
page_template[source]
exception[source]
static json_formatter(status: str, body: str, title: str, environ: weaver.typedefs.SettingsType)weaver.typedefs.JSON[source]
prepare(self, environ)[source]
property wsgi_response(self)[source]
exception weaver.owsexceptions.OWSAccessForbidden(*args, **kwargs)[source]

Represents a WSGI response.

If no arguments are passed, creates a Response that uses a variety of defaults. The defaults may be changed by sub-classing the Response. See the sub-classing notes.

Variables
  • body (bytes or text_type) – If body is a text_type, then it will be encoded using either charset when provided or default_encoding when charset is not provided if the content_type allows for a charset. This argument is mutually exclusive with app_iter.

  • status (int or str) – Either an int or a string that is an integer followed by the status text. If it is an integer, it will be converted to a proper status that also includes the status text. Any existing status text will be kept. Non-standard values are allowed.

  • headerlist (list) – A list of HTTP headers for the response.

  • app_iter (iterable) – An iterator that is used as the body of the response. Should conform to the WSGI requirements and should provide bytes. This argument is mutually exclusive with body.

  • content_type (str or None) – Sets the Content-Type header. If no content_type is provided, and there is no headerlist, the default_content_type will be automatically set. If headerlist is provided then this value is ignored.

  • conditional_response (bool) – Used to change the behavior of the Response to check the original request for conditional response headers. See conditional_response_app() for more information.

  • charset (str or None) – Adds a charset Content-Type parameter. If no charset is provided and the Content-Type is text, then the default_charset will automatically be added. Currently the only Content-Type’s that allow for a charset are defined to be text/*, application/xml, and */*+xml. Any other Content-Type’s will not have a charset added. If a headerlist is provided this value is ignored.

All other response attributes may be set on the response by providing them as keyword arguments. A TypeError will be raised for any unexpected keywords.

Sub-classing notes:

  • The default_content_type is used as the default for the Content-Type header that is returned on the response. It is text/html.

  • The default_charset is used as the default character set to return on the Content-Type header, if the Content-Type allows for a charset parameter. Currently the only Content-Type’s that allow for a charset are defined to be: text/*, application/xml, and */*+xml. Any other Content-Type’s will not have a charset added.

  • The unicode_errors is set to strict, and access on a text will raise an error if it fails to decode the body.

  • default_conditional_response is set to False. This flag may be set to True so that all Response objects will attempt to check the original request for conditional response headers. See conditional_response_app() for more information.

  • default_body_encoding is set to ‘UTF-8’ by default. It exists to allow users to get/set the Response object using .text, even if no charset has been set for the Content-Type.

Initialize self. See help(type(self)) for accurate signature.

code = AccessForbidden[source]
locator =[source]
explanation = Access to this service is forbidden.[source]
exception weaver.owsexceptions.OWSNotFound(*args, **kwargs)[source]

Represents a WSGI response.

If no arguments are passed, creates a Response that uses a variety of defaults. The defaults may be changed by sub-classing the Response. See the sub-classing notes.

Variables
  • body (bytes or text_type) – If body is a text_type, then it will be encoded using either charset when provided or default_encoding when charset is not provided if the content_type allows for a charset. This argument is mutually exclusive with app_iter.

  • status (int or str) – Either an int or a string that is an integer followed by the status text. If it is an integer, it will be converted to a proper status that also includes the status text. Any existing status text will be kept. Non-standard values are allowed.

  • headerlist (list) – A list of HTTP headers for the response.

  • app_iter (iterable) – An iterator that is used as the body of the response. Should conform to the WSGI requirements and should provide bytes. This argument is mutually exclusive with body.

  • content_type (str or None) – Sets the Content-Type header. If no content_type is provided, and there is no headerlist, the default_content_type will be automatically set. If headerlist is provided then this value is ignored.

  • conditional_response (bool) – Used to change the behavior of the Response to check the original request for conditional response headers. See conditional_response_app() for more information.

  • charset (str or None) – Adds a charset Content-Type parameter. If no charset is provided and the Content-Type is text, then the default_charset will automatically be added. Currently the only Content-Type’s that allow for a charset are defined to be text/*, application/xml, and */*+xml. Any other Content-Type’s will not have a charset added. If a headerlist is provided this value is ignored.

All other response attributes may be set on the response by providing them as keyword arguments. A TypeError will be raised for any unexpected keywords.

Sub-classing notes:

  • The default_content_type is used as the default for the Content-Type header that is returned on the response. It is text/html.

  • The default_charset is used as the default character set to return on the Content-Type header, if the Content-Type allows for a charset parameter. Currently the only Content-Type’s that allow for a charset are defined to be: text/*, application/xml, and */*+xml. Any other Content-Type’s will not have a charset added.

  • The unicode_errors is set to strict, and access on a text will raise an error if it fails to decode the body.

  • default_conditional_response is set to False. This flag may be set to True so that all Response objects will attempt to check the original request for conditional response headers. See conditional_response_app() for more information.

  • default_body_encoding is set to ‘UTF-8’ by default. It exists to allow users to get/set the Response object using .text, even if no charset has been set for the Content-Type.

Initialize self. See help(type(self)) for accurate signature.

code = NotFound[source]
locator =[source]
explanation = Resource does not exist.[source]
exception weaver.owsexceptions.OWSNotAcceptable(*args, **kwargs)[source]

Represents a WSGI response.

If no arguments are passed, creates a Response that uses a variety of defaults. The defaults may be changed by sub-classing the Response. See the sub-classing notes.

Variables
  • body (bytes or text_type) – If body is a text_type, then it will be encoded using either charset when provided or default_encoding when charset is not provided if the content_type allows for a charset. This argument is mutually exclusive with app_iter.

  • status (int or str) – Either an int or a string that is an integer followed by the status text. If it is an integer, it will be converted to a proper status that also includes the status text. Any existing status text will be kept. Non-standard values are allowed.

  • headerlist (list) – A list of HTTP headers for the response.

  • app_iter (iterable) – An iterator that is used as the body of the response. Should conform to the WSGI requirements and should provide bytes. This argument is mutually exclusive with body.

  • content_type (str or None) – Sets the Content-Type header. If no content_type is provided, and there is no headerlist, the default_content_type will be automatically set. If headerlist is provided then this value is ignored.

  • conditional_response (bool) – Used to change the behavior of the Response to check the original request for conditional response headers. See conditional_response_app() for more information.

  • charset (str or None) – Adds a charset Content-Type parameter. If no charset is provided and the Content-Type is text, then the default_charset will automatically be added. Currently the only Content-Type’s that allow for a charset are defined to be text/*, application/xml, and */*+xml. Any other Content-Type’s will not have a charset added. If a headerlist is provided this value is ignored.

All other response attributes may be set on the response by providing them as keyword arguments. A TypeError will be raised for any unexpected keywords.

Sub-classing notes:

  • The default_content_type is used as the default for the Content-Type header that is returned on the response. It is text/html.

  • The default_charset is used as the default character set to return on the Content-Type header, if the Content-Type allows for a charset parameter. Currently the only Content-Type’s that allow for a charset are defined to be: text/*, application/xml, and */*+xml. Any other Content-Type’s will not have a charset added.

  • The unicode_errors is set to strict, and access on a text will raise an error if it fails to decode the body.

  • default_conditional_response is set to False. This flag may be set to True so that all Response objects will attempt to check the original request for conditional response headers. See conditional_response_app() for more information.

  • default_body_encoding is set to ‘UTF-8’ by default. It exists to allow users to get/set the Response object using .text, even if no charset has been set for the Content-Type.

Initialize self. See help(type(self)) for accurate signature.

code = NotAcceptable[source]
locator =[source]
explanation = Cannot produce requested Accept format.[source]
exception weaver.owsexceptions.OWSNoApplicableCode(*args, **kwargs)[source]

WPS Bad Request Exception

Initialize self. See help(type(self)) for accurate signature.

code = NoApplicableCode[source]
locator =[source]
explanation = Undefined error[source]
exception weaver.owsexceptions.OWSMissingParameterValue(*args, **kwargs)[source]

MissingParameterValue WPS Exception

Initialize self. See help(type(self)) for accurate signature.

code = MissingParameterValue[source]
locator =[source]
description = Parameter value is missing[source]
exception weaver.owsexceptions.OWSInvalidParameterValue(*args, **kwargs)[source]

InvalidParameterValue WPS Exception

Initialize self. See help(type(self)) for accurate signature.

code = InvalidParameterValue[source]
locator =[source]
description = Parameter value is not acceptable.[source]
exception weaver.owsexceptions.OWSNotImplemented(*args, **kwargs)[source]

Represents a WSGI response.

If no arguments are passed, creates a Response that uses a variety of defaults. The defaults may be changed by sub-classing the Response. See the sub-classing notes.

Variables
  • body (bytes or text_type) – If body is a text_type, then it will be encoded using either charset when provided or default_encoding when charset is not provided if the content_type allows for a charset. This argument is mutually exclusive with app_iter.

  • status (int or str) – Either an int or a string that is an integer followed by the status text. If it is an integer, it will be converted to a proper status that also includes the status text. Any existing status text will be kept. Non-standard values are allowed.

  • headerlist (list) – A list of HTTP headers for the response.

  • app_iter (iterable) – An iterator that is used as the body of the response. Should conform to the WSGI requirements and should provide bytes. This argument is mutually exclusive with body.

  • content_type (str or None) – Sets the Content-Type header. If no content_type is provided, and there is no headerlist, the default_content_type will be automatically set. If headerlist is provided then this value is ignored.

  • conditional_response (bool) – Used to change the behavior of the Response to check the original request for conditional response headers. See conditional_response_app() for more information.

  • charset (str or None) – Adds a charset Content-Type parameter. If no charset is provided and the Content-Type is text, then the default_charset will automatically be added. Currently the only Content-Type’s that allow for a charset are defined to be text/*, application/xml, and */*+xml. Any other Content-Type’s will not have a charset added. If a headerlist is provided this value is ignored.

All other response attributes may be set on the response by providing them as keyword arguments. A TypeError will be raised for any unexpected keywords.

Sub-classing notes:

  • The default_content_type is used as the default for the Content-Type header that is returned on the response. It is text/html.

  • The default_charset is used as the default character set to return on the Content-Type header, if the Content-Type allows for a charset parameter. Currently the only Content-Type’s that allow for a charset are defined to be: text/*, application/xml, and */*+xml. Any other Content-Type’s will not have a charset added.

  • The unicode_errors is set to strict, and access on a text will raise an error if it fails to decode the body.

  • default_conditional_response is set to False. This flag may be set to True so that all Response objects will attempt to check the original request for conditional response headers. See conditional_response_app() for more information.

  • default_body_encoding is set to ‘UTF-8’ by default. It exists to allow users to get/set the Response object using .text, even if no charset has been set for the Content-Type.

Initialize self. See help(type(self)) for accurate signature.

code = NotImplemented[source]
locator =[source]
description = Operation is not implemented.[source]
weaver.sort
Module Contents
weaver.sort.SORT_CREATED = created[source]
weaver.sort.SORT_FINISHED = finished[source]
weaver.sort.SORT_STATUS = status[source]
weaver.sort.SORT_PROCESS = process[source]
weaver.sort.SORT_SERVICE = service[source]
weaver.sort.SORT_USER = user[source]
weaver.sort.SORT_QUOTE = quote[source]
weaver.sort.SORT_PRICE = price[source]
weaver.sort.SORT_ID = id[source]
weaver.sort.JOB_SORT_VALUES[source]
weaver.sort.QUOTE_SORT_VALUES[source]
weaver.sort.BILL_SORT_VALUES[source]
weaver.status
Module Contents
weaver.status.AnyStatusType[source]
weaver.status.STATUS_COMPLIANT_OGC = STATUS_COMPLIANT_OGC[source]
weaver.status.STATUS_COMPLIANT_PYWPS = STATUS_COMPLIANT_PYWPS[source]
weaver.status.STATUS_COMPLIANT_OWSLIB = STATUS_COMPLIANT_OWSLIB[source]
weaver.status.STATUS_CATEGORY_FINISHED = STATUS_CATEGORY_FINISHED[source]
weaver.status.STATUS_CATEGORY_RUNNING = STATUS_CATEGORY_RUNNING[source]
weaver.status.STATUS_CATEGORY_FAILED = STATUS_CATEGORY_FAILED[source]
weaver.status.STATUS_ACCEPTED = accepted[source]
weaver.status.STATUS_STARTED = started[source]
weaver.status.STATUS_PAUSED = paused[source]
weaver.status.STATUS_SUCCEEDED = succeeded[source]
weaver.status.STATUS_FAILED = failed[source]
weaver.status.STATUS_RUNNING = running[source]
weaver.status.STATUS_DISMISSED = dismissed[source]
weaver.status.STATUS_EXCEPTION = exception[source]
weaver.status.STATUS_UNKNOWN = unknown[source]
weaver.status.JOB_STATUS_VALUES[source]
weaver.status.JOB_STATUS_CATEGORIES[source]
weaver.status.STATUS_PYWPS_MAP[source]
weaver.status.STATUS_PYWPS_IDS[source]
weaver.status.map_status(wps_status: AnyStatusType, compliant: str = STATUS_COMPLIANT_OGC)str[source]

Maps WPS statuses (weaver.status, OWSLib or PyWPS) to OWSLib/PyWPS compatible values. For each compliant combination, unsupported statuses are changed to corresponding ones (with closest logical match). Statuses are returned with weaver.status.JOB_STATUS_VALUES format (lowercase and not preceded by ‘Process’).

Parameters
  • wps_status – one of weaver.status.JOB_STATUS_VALUES to map to compliant standard or PyWPS int status.

  • compliant – one of STATUS_COMPLIANT_[…] values.

Returns

mapped status complying to the requested compliant category, or STATUS_UNKNOWN if no match found.

weaver.tweens
Module Contents
weaver.tweens.LOGGER[source]
weaver.tweens.OWS_TWEEN_HANDLED = OWS_TWEEN_HANDLED[source]
weaver.tweens.error_repr(http_err: Union[pyramid.httpexceptions.HTTPException, weaver.owsexceptions.OWSException, Exception])str[source]

Returns a cleaned up representation string of the HTTP error, but with similar and even extended details to facilitate later debugging.

weaver.tweens.ows_response_tween(request, handler)[source]

Tween that wraps any API request with appropriate dispatch of error conversion to handle formatting.

weaver.tweens.ows_response_tween_factory_excview(handler, registry)[source]

A tween factory which produces a tween which transforms common exceptions into OWS specific exceptions.

weaver.tweens.ows_response_tween_factory_ingress(handler, registry)[source]

A tween factory which produces a tween which transforms common exceptions into OWS specific exceptions.

weaver.tweens.OWS_RESPONSE_EXCVIEW[source]
weaver.tweens.OWS_RESPONSE_INGRESS[source]
weaver.tweens.includeme(config)[source]
weaver.typedefs
Module Contents
weaver.typedefs.XML[source]
weaver.typedefs.FileSystemPathType[source]
weaver.utils
Module Contents
weaver.utils.LOGGER[source]
weaver.utils.SUPPORTED_FILE_SCHEMES[source]
class weaver.utils._Singleton[source]
class weaver.utils.NullType[source]

Represents a null value to differentiate from None.

weaver.utils.null[source]
weaver.utils.get_weaver_url(container: weaver.typedefs.AnySettingsContainer)str[source]

Retrieves the home URL of the weaver application.

weaver.utils.get_any_id(info: weaver.typedefs.JSON)Union[str, None][source]

Retrieves a dictionary id-like key using multiple common variations [id, identifier, _id]. :param info: dictionary that potentially contains an id-like key. :returns: value of the matched id-like key or None if not found.

weaver.utils.get_any_value(info: weaver.typedefs.JSON)weaver.typedefs.AnyValue[source]

Retrieves a dictionary value-like key using multiple common variations [href, value, reference]. :param info: dictionary that potentially contains a value-like key. :returns: value of the matched value-like key or None if not found.

weaver.utils.get_any_message(info: weaver.typedefs.JSON)str[source]

Retrieves a dictionary ‘value’-like key using multiple common variations [message]. :param info: dictionary that potentially contains a ‘message’-like key. :returns: value of the matched ‘message’-like key or an empty string if not found.

weaver.utils.get_registry(container: weaver.typedefs.AnyRegistryContainer, nothrow: bool = False)Optional[pyramid.registry.Registry][source]

Retrieves the application registry from various containers referencing to it.

weaver.utils.get_settings(container: Optional[weaver.typedefs.AnySettingsContainer] = None)weaver.typedefs.SettingsType[source]

Retrieves the application settings from various containers referencing to it.

weaver.utils.get_header(header_name: str, header_container: weaver.typedefs.AnyHeadersContainer)Union[str, None][source]

Searches for the specified header by case/dash/underscore-insensitive header_name inside header_container.

Looks for cookie_header_name header within header_container. :returns: new header container in the form {'Cookie': <found_cookie>} if it was matched, or empty otherwise.

weaver.utils.get_url_without_query(url: Union[str, urllib.parse.ParseResult])str[source]

Removes the query string part of an URL.

weaver.utils.is_valid_url(url: Optional[str])bool[source]
weaver.utils.UUID_PATTERN[source]
weaver.utils.is_uuid(maybe_uuid: Any)bool[source]

Evaluates if the provided input is a UUID-like string.

weaver.utils.parse_extra_options(option_str: str)Dict[str, str][source]

Parses the extra options parameter.

The option_str is a string with coma separated opt=value pairs. Example:

tempdir=/path/to/tempdir,archive_root=/path/to/archive
Parameters

option_str – A string parameter with the extra options.

Returns

A dict with the parsed extra options.

weaver.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.

weaver.utils.now()datetime.datetime[source]
weaver.utils.now_secs()int[source]

Return the current time in seconds since the Epoch.

weaver.utils.wait_secs(run_step=- 1)[source]
weaver.utils.expires_at(hours: Optional[int] = 1)int[source]
weaver.utils.localize_datetime(dt: datetime.datetime, tz_name: Optional[str] = 'UTC')datetime.datetime[source]

Provide a timezone-aware object for a given datetime and timezone name.

weaver.utils.get_base_url(url: str)str[source]

Obtains the base URL from the given url.

weaver.utils.xml_path_elements(path: str)List[str][source]
weaver.utils.xml_strip_ns(tree: weaver.typedefs.XML)None[source]
weaver.utils.ows_context_href(href: str, partial: Optional[bool] = False)weaver.typedefs.JSON[source]

Returns the complete or partial dictionary defining an OWSContext from a reference.

weaver.utils.pass_http_error(exception: Exception, expected_http_error: Union[Type[pyramid.httpexceptions.HTTPError], Iterable[Type[pyramid.httpexceptions.HTTPError]]])None[source]

Given an HTTPError of any type (pyramid, requests), ignores (pass) the exception if the actual error matches the status code. Other exceptions are re-raised.

Parameters
  • exception – any Exception instance (“object” from a try..except exception as “object” block).

  • expected_http_error – single or list of specific pyramid HTTPError to handle and ignore.

Raises

exception – if it doesn’t match the status code or is not an HTTPError of any module.

weaver.utils.raise_on_xml_exception(xml_node: weaver.typedefs.XML)Optional[NoReturn][source]

Raises an exception with the description if the XML response document defines an ExceptionReport. :param xml_node: instance of XML :raise Exception: on found ExceptionReport document.

weaver.utils.str2bytes(string: Union[str, bytes])bytes[source]

Obtains the bytes representation of the string.

weaver.utils.bytes2str(string: Union[str, bytes])str[source]

Obtains the unicode representation of the string.

weaver.utils.islambda(func: Any)bool[source]
weaver.utils.first_cap_re[source]
weaver.utils.all_cap_re[source]
weaver.utils.convert_snake_case(name: str)str[source]
weaver.utils.parse_request_query(request: pyramid.request.Request)Dict[str, Dict[weaver.typedefs.AnyKey, str]][source]
Parameters

request

Returns

dict of dict where k=v are accessible by d[k][0] == v and q=k=v are accessible by d[q][k] == v, lowercase

weaver.utils.get_path_kvp(path: str, sep: str = ',', **params: weaver.typedefs.KVP_Item)str[source]

Generates the WPS URL with Key-Value-Pairs (KVP) query parameters.

Parameters
  • path – WPS URL or Path

  • sep – separator to employ when multiple values are provided.

  • params – keyword parameters and their corresponding single or multi values to generate KVP.

Returns

combined path and query parameters as KVP.

weaver.utils.get_log_fmt()str[source]

Logging format employed for job output reporting.

weaver.utils.get_log_date_fmt()str[source]

Logging date format employed for job output reporting.

weaver.utils.get_log_monitor_msg(job_id: str, status: str, percent: weaver.typedefs.Number, message: str, location: str)str[source]
weaver.utils.get_job_log_msg(status: str, message: str, progress: Optional[weaver.typedefs.Number] = 0, duration: Optional[str] = None)str[source]
weaver.utils.setup_loggers(settings: weaver.typedefs.AnySettingsContainer, level: Optional[Union[int, str]] = None)None[source]

Update logging configuration known loggers based on application settings.

When weaver.log_level exists in settings, it overrides any other INI configuration logging levels. Otherwise, undefined logger levels will be set according to whichever is found first between weaver.log_level, the level parameter or default logging.INFO.

weaver.utils.make_dirs(path, mode=493, exist_ok=False)[source]

Alternative to os.makedirs with exists_ok parameter only available for python>3.5. Also using a reduced set of permissions 755 instead of original default 777.

Note

The method employed in this function is safer then if os.pat.exists or if os.pat.isdir pre-check to calling os.makedirs as this can result in race condition (between evaluation and actual creation).

weaver.utils.get_caller_name(skip=2, base_class=False)[source]

Returns the name of a caller in the format module.class.method.

Parameters
  • skip – specifies how many levels of stack to skip while getting the caller.

  • base_class – Specified if the base class should be returned or the top-most class in case of inheritance If the caller is not a class, this doesn’t do anything.

Returns

An empty string if skipped levels exceed stack height; otherwise, the requested caller name.

weaver.utils.setup_cache(settings: weaver.typedefs.SettingsType)None[source]

Prepares the settings with default caching options.

weaver.utils.invalidate_region(caching_args: Tuple[Callable, str, Tuple[Any]])None[source]

Caching region invalidation with handling to ignore errors generated by of unknown regions.

Parameters

caching_args – tuple of (function, region, *function-args)

weaver.utils.get_ssl_verify_option(method: str, url: str, settings: weaver.typedefs.AnySettingsContainer, request_options: Optional[weaver.typedefs.SettingsType] = None)bool[source]

Obtains the SSL verification option from combined settings from weaver.ssl_verify and parsed weaver.request_options file for the corresponding request.

Parameters
  • method – request method (GET, POST, etc.).

  • url – request URL.

  • settings – application setting container with pre-loaded request options specifications.

  • request_options – pre-processed request options for method/URL to avoid re-parsing the settings.

Returns

SSL verify option to be passed down to some request function.

weaver.utils.get_no_cache_option(request_headers: weaver.typedefs.HeadersType, request_options: weaver.typedefs.SettingsType)bool[source]

Obtains the No-Cache result from request headers and configured request options.

See also

Parameters
  • request_headers – specific request headers that could indicate Cache-Control: no-cache

  • request_options – specific request options that could define cache: True|False

Returns

whether to disable cache or not

weaver.utils.get_request_options(method: str, url: str, settings: weaver.typedefs.AnySettingsContainer)weaver.typedefs.SettingsType[source]

Obtains the request options corresponding to the request according to configuration file specified by pre-loaded setting weaver.request_options.

If no file was pre-loaded or no match is found for the request, an empty options dictionary is returned.

Parameters
  • method – request method (GET, POST, etc.).

  • url – request URL.

  • settings – application setting container with pre-loaded request options specifications.

Returns

dictionary with keyword options to be applied to the corresponding request if matched.

weaver.utils.retry_on_cache_error(func: Callable[[], Any])Callable[source]

Decorator to handle invalid cache setup.

Any function wrapped with this decorator will retry execution once if missing cache setup was the cause of error.

weaver.utils._request_call(method: str, url: str, kwargs: Dict[str, weaver.typedefs.AnyValue])requests.Response[source]

Request operation employed by request_extra() without caching.

weaver.utils._request_cached(method: str, url: str, kwargs: Dict[str, weaver.typedefs.AnyValue])requests.Response[source]

Cached-enabled request operation employed by request_extra().

weaver.utils.request_extra(method: str, url: str, retries: Optional[int] = None, backoff: Optional[weaver.typedefs.Number] = None, intervals: Optional[List[weaver.typedefs.Number]] = None, retry_after: bool = True, allowed_codes: Optional[List[int]] = None, only_server_errors: bool = True, ssl_verify: Optional[bool] = None, settings: Optional[weaver.typedefs.AnySettingsContainer] = None, **request_kwargs)weaver.typedefs.AnyResponseType[source]

Standard library requests with additional functional utilities.

Retry operation

Implements request retry if the previous request failed, up to the specified number of retries. Using backoff factor, you can control the interval between request attempts such as:

delay = backoff * (2 ^ retry)

Alternatively, you can explicitly define intervals=[...] with the list values being the number of seconds to wait between each request attempt. In this case, backoff is ignored and retries is overridden accordingly with the number of items specified in the list.

Furthermore, retry_after (default: True) indicates if HTTP status code 429 (Too Many Requests) should be automatically handled during retries. If enabled and provided in the previously failed request response through the Retry-After header, the next request attempt will be executed only after the server-specified delay instead of following the calculated delay from retries and backoff, or from corresponding index of interval, accordingly to specified parameters. This will avoid uselessly calling the server and automatically receive a denied response. You can disable this feature by passing False, which will result into requests being retried blindly without consideration of the called server instruction.

Because different request implementations use different parameter naming conventions, all following keywords are looked for:

  • Both variants of backoff and backoff_factor are accepted.

  • All variants of retires, retry and max_retries are accepted.

Note

Total amount of executed request attempts will be +1 the number of retries or intervals items as first request is done immediately, and following attempts are done with the appropriate delay.

File Transport Scheme

Any request with file:// scheme or empty scheme (no scheme specified) will be automatically handled as potential local file path. The path should be absolute to ensure it to be correctly resolved.

All access errors due to file permissions return 403 status code, and missing file returns 404. Any other IOError types are converted to a 400 responses.

See also

  • FileAdapter

SSL Verification

Allows SSL verify option to be enabled or disabled according to configuration settings or explicit parameters. Any variation of verify or ssl_verify keyword arguments are considered. If they all resolve to True, then application settings are retrieved from weaver.ini to parse additional SSL options that could disable it.

Following weaver settings are considered :
  • weaver.ssl_verify = True|False

  • weaver.request_options = request_options.yml

Note

Argument settings must also be provided through any supported container by get_settings() to retrieve and apply any weaver-specific configurations.

Parameters
  • method – HTTP method to set request.

  • url – URL of the request to execute.

  • retries – Number of request retries to attempt if first attempt failed (according to allowed codes or error).

  • backoff – Factor by which to multiply delays between retries.

  • intervals – Explicit intervals in seconds between retries.

  • retry_after – If enabled, honor Retry-After response header of provided by a failing request attempt.

  • allowed_codes – HTTP status codes that are considered valid to stop retrying (default: any non-4xx/5xx code).

  • ssl_verify – Explicit parameter to disable SSL verification (overrides any settings, default: True).

  • settings – Additional settings from which to retrieve configuration details for requests.

  • only_server_errors – Only HTTP status codes in the 5xx values will be considered for retrying the request (default: True). This catches sporadic server timeout, connection error, etc., but 4xx errors are still considered valid results. This parameter is ignored if allowed codes are explicitly specified.

  • request_kwargs – All other keyword arguments are passed down to the request call.

weaver.utils.fetch_file(file_reference: str, file_outdir: str, settings: Optional[weaver.typedefs.AnySettingsContainer] = None, **request_kwargs: Any)str[source]

Fetches a file from a local path, an AWS-S3 bucket or remote URL, and dumps it’s content to the specified output directory.

The output directory is expected to exist prior to this function call. The file reference scheme (protocol) determines from where to fetch the content. Output file name and extension will be the same as the original. Requests will consider weaver.request_options when using http(s):// scheme.

Parameters
  • file_reference – Local filesystem path (optionally prefixed with file://), s3:// bucket location or http(s):// remote URL file reference. Reference https://s3.[...] are also considered as s3://.

  • file_outdir – Output local directory path under which to place the fetched file.

  • settings – Additional request-related settings from the application configuration (notably request-options).

  • request_kwargs – Additional keywords to forward to request call (if needed).

Returns

Path of the local copy of the fetched file.

Raises
  • HTTPException – applicable HTTP-based exception if any occurred during the operation.

  • ValueError – when the reference scheme cannot be identified.

weaver.utils.REGEX_SEARCH_INVALID_CHARACTERS[source]
weaver.utils.REGEX_ASSERT_INVALID_CHARACTERS[source]
weaver.utils.get_sane_name(name: str, min_len: Optional[int] = 3, max_len: Optional[Union[int, None]] = None, assert_invalid: Optional[bool] = True, replace_character: str = '_')Union[str, None][source]

Returns a cleaned-up version of the name, replacing invalid characters not matched with REGEX_SEARCH_INVALID_CHARACTERS by replace_character.

Parameters
  • name – Value to clean.

  • min_len – Minimal length of name` to be respected, raises or returns None on fail according to assert_invalid.

  • max_len – Maximum length of name to be respected, raises or returns trimmed name on fail according to assert_invalid. If None, condition is ignored for assertion or full name is returned respectively.

  • assert_invalid – If True, fail conditions or invalid characters will raise an error instead of replacing.

  • replace_character – Single character to use for replacement of invalid ones if assert_invalid is False.

weaver.utils.assert_sane_name(name, min_len=3, max_len=None)[source]

Asserts that the sane name respects conditions.

See also

weaver.utils.clean_json_text_body(body: str, remove_newlines: bool = True, remove_indents: bool = True)str[source]

Cleans a textual body field of superfluous characters to provide a better human-readable text in a JSON response.

weaver.utils.transform_json(json_data: weaver.typedefs.JSON, rename: Optional[Dict[weaver.typedefs.AnyKey, Any]] = None, remove: Optional[List[weaver.typedefs.AnyKey]] = None, add: Optional[Dict[weaver.typedefs.AnyKey, Any]] = None, replace_values: Optional[Dict[weaver.typedefs.AnyKey, Any]] = None, replace_func: Optional[Dict[weaver.typedefs.AnyKey, Callable[[Any], Any]]] = None)weaver.typedefs.JSON[source]

Transforms the input json_data with different methods. The transformations are applied in the same order as the arguments.

weaver.visibility
Module Contents
weaver.visibility.VISIBILITY_PUBLIC = public[source]
weaver.visibility.VISIBILITY_PRIVATE = private[source]
weaver.visibility.VISIBILITY_VALUES[source]
weaver.warning
Module Contents
exception weaver.warning.TimeZoneInfoAlreadySetWarning[source]

Warn when trying to obtain a localized time with already defined time-zone info.

Initialize self. See help(type(self)) for accurate signature.

exception weaver.warning.DisabledSSLCertificateVerificationWarning[source]

Warn when an option to disable SSL certificate verification is employed for some operations.

Initialize self. See help(type(self)) for accurate signature.

exception weaver.warning.UnsupportedOperationWarning[source]

Warn about an operation not yet implemented or unsupported according to context.

Initialize self. See help(type(self)) for accurate signature.

exception weaver.warning.NonBreakingExceptionWarning[source]

Warn about an exception that is handled (ex: caught in try/except block) but still unexpected.

Initialize self. See help(type(self)) for accurate signature.

exception weaver.warning.MissingParameterWarning[source]

Warn about an expected but missing parameter.

Initialize self. See help(type(self)) for accurate signature.

Package Contents
weaver.LOGGER[source]
weaver.WEAVER_MODULE_DIR[source]
weaver.WEAVER_ROOT_DIR[source]
weaver.WEAVER_CONFIG_DIR[source]
weaver.main(global_config, **settings)[source]
weaver.includeme(config)[source]
1

Created with sphinx-autoapi

Changes

Unreleased (latest)

Changes:
  • No change.

Fixes:
  • No change.

3.2.0 (2021-06-08)

Changes:
  • Add reference link to ReadTheDocs URL of Weaver in API landing page.

  • Add references to OGC-API Processes requirements and recommendations for eventual conformance listing (relates to #231).

  • Add datetime query parameter for job searches queries (relates to #236).

  • Add limit query parameter validation and integration for jobs in retrieve queries (relates to #237).

Fixes:
  • Pin pywps==4.4.3 and fix incompatibility introduced by its refactor of I/O base classes in #602 (specifically commit 343d825), which broke the ComplexInput work-around to avoid useless of file URLs (see issue #526).

  • Fix default execution mode specification in process job control options (fixes #182).

  • Fix old OGC-API WPS REST bindings link in landing page for the more recent OGC-API Processes specification.

  • Fix invalid deserialization of schemas using not keyword that would result in all fields returned instead of limiting them to the expected fields from the schema definitions for LiteralInputType in process description.

  • Adjust InputType and OutputType schemas to use allOf instead of anyOf definition since all sub-schemas that define them must be combined, with their respectively required or optional fields.

3.1.0 (2021-04-23)

Changes:
  • Add caching of remote WPS requests according to request-options.yml and request header Cache-Control to allow reduced query of pre-fetched WPS client definition.

  • Add POST /processes/{}/execution endpoint that mimics its jobs counterpart to respect OGC-API Processes updates (see issue opengeospatial/ogcapi-processes#124 and PR opengeospatial/ogcapi-processes#159, resolves #235).

  • Add OpenAPI schema examples for some of the most common responses.

  • Add missing schema definitions for WPS XML requests and responses.

  • Improve schema self-validation with their specified default values.

  • Add explicit options usage and expected parsing results for all test variations of OpenAPI schemas generation and colander object arguments for future reference in tests.wps_restapi.test_colander_extras.

Fixes:
  • Fix erroneous tags in job inputs schemas.

  • Fix handling of deeply nested schema validator raising for invalid format within optional parent schema.

  • Fix retrieval of database connection from registry reference.

  • Fix test mock according to installed pyramid version to avoid error with modified mixin implementations.

3.0.0 (2021-03-16)

Changes:
  • Provide HTTP links to corresponding items of job in JSON body of status, inputs and outputs routes (#58, #86).

  • Provide Job.started datetime and calculate Job.duration from it to indicate the duration of the process execution instead of counting from the time the job was submitted (i.e.: Job.created).

  • Provide OGC compliant <job-uri>/results response schema as well as some expected code/description fields in case where the request fails.

  • Add <job-uri>/outputs providing the data/href formatted job results as well as <job-uri>/inputs to retrieve the inputs that were provided during job submission (#86).

  • Deprecate <job-uri>/result paths (indicated in OpenAPI schemas and UI) in favor of <job-uri>/outputs which provides the same structure with additional links references (#58). Result path requests are redirected automatically to outputs.

  • Add more reference/documentation links to WPS-1/2 and update conformance references (#53).

  • Add some minimal caching support of routes.

  • Adjust job creation route to return 201 (created) as it is now correctly defined by the OGC API specification (#14).

  • Add Job.link method that auto-generates all applicable links (inputs, outputs, logs, etc.).

  • Add image/jpeg, image/png, image/tiff formats to supported weaver.formats (relates to #100).

  • Handle additional trailing slash resulting in HTTPNotFound [404] to automatically resolve to corresponding valid route without the slash when applicable.

  • Provide basic conda environment setup through Makefile for Windows bash-like shell (ie: MINGW/MINGW64).

  • Update documentation for minimal adjustments needed to run under Windows.

  • Update OpenAPI template to not render the useless version selector since we only provide the current version.

  • Update Swagger definitions to reflect changes and better reuse existing schemas.

  • Update Swagger UI to provide the ReadTheDocs URL.

  • Add crim-ca/cwltool@docker-gpu as cwltool requirement to allow processing of GPU-enabled dockers with nvidia-docker.

  • Add fmigneault/cornice.ext.swagger@openapi-3 as cornice_swagger requirement to allow OpenAPI-3 definitions support of schema generation and deserialization validation of JSON payloads.

  • Disable default auto-generation of request-options.yml and wps_processes.yml configuration files from a copy of their respective .example files as these have many demo (and invalid values) that fail real execution of tests when no actual file was provided.

  • Add per-request caching support when using request_extra function, and caching control according to request headers and request-options.yml configuration.

Fixes:
  • Fix weaver.config.get_weaver_config_file called with empty path to be resolved just as requesting the default file path explicitly instead of returning an invalid directory.

  • Fix CWL package path resolution under Windows incorrectly parsed partition as URL protocol.

  • Fix AttributeError of pywps.inout.formats.Format equality check compared to null object (using getter patch on null since fix #507 not released at this point).

  • Fix potential invalid database state that could have saved an invalid process although the following ProcessSummary schema validation would fail and return HTTPBadRequest [400]. The process is now saved only after complete and successful schema validation.

2.2.0 (2021-03-03)

Changes:
  • Add weaver.wps.utils.get_wps_client function to handle the creation of owslib.wps.WebProcessingService client with appropriate request options configuration from application settings.

Fixes:
  • Fix job percent progress reported in logs to be more consistent with actual execution of the process (fixes #90).

  • Fix Job duration not stopped incrementing when its execution failed due to raised error (fixes #222).

  • Improve race condition handling of builtin process registration at application startup.

2.1.0 (2021-02-26)

Changes:
  • Ensure that configuration file definitions specified in processes and providers will override older database definitions respectively matched by id and name when starting Weaver if other parameters were modified.

  • Support dynamic instantiation of WPS-1/2 processes from remote WPS providers to accomplish job execution.

  • Remove previously flagged duplicate code to handle OWSLib processes conversion to JSON for OGC-API.

  • Replace GET HTTP request by HEAD for MIME-type check against IANA definitions (speed up).

  • Improve handling of CWL input generation in combination with minOccurs, maxOccurs, allowedValues and default empty ("null") value from WPS process from remote provider (fix #17).

  • Add hybrid mode that allows Weaver to simultaneously run local Application Packages and remote WPS providers.

  • Rename ows2json_output to ows2json_output_data to emphasise its usage for parsing job result data rather than simple output definition as accomplished by ows2json_io.

  • Remove function duplicating operations accomplished by ows2json_io (previously marked with FIXME).

  • Improve typing definitions for CWL elements to help identify invalid parsing methods during development.

  • Improve listing speed of remote providers that require data fetch when some of them might have become unreachable.

Fixes:
  • Avoid failing WPS-1/2 processes conversion to corresponding OGC-API process if metadata fields are omitted.

  • Fix invalid function employed for GET /providers/{prov}/processes/{proc} route (some error handling was bypassed).

2.0.0 (2021-02-22)

Changes:
  • Add support of YAML format for loading weaver.data_sources definition.

  • Pre-install Docker CLI in worker image to avoid bad practice of mounting it from the host.

  • Adjust WPS request dispatching such that process jobs get executed by Celery worker as intended (see #21 and #126).

  • Move WPS XML endpoint functions under separate weaver.wps.utils and weaver.wps.views to remove the need to constantly handle circular imports issues due to processing related operations that share some code.

  • Move core processing of job operation by Celery worker under weaver.processes.execution in order to separate those components from functions specific for producing WPS-REST API responses.

  • Handle WPS-1/2 requests submitted by GET KVP or POST XML request with application/json in Accept header to return the same body content as if directly calling their corresponding WPS-REST endpoints.

  • Remove request parameter of every database store methods since they were not used nor provided most of the time.

  • Changed all forbidden access responses related to visibility status to return 403 instead of 401.

  • Add more tests for Docker applications and test suite execution with Github Actions.

  • Add more details in sample configurations and provide an example docker-compose.yml configuration that defines a typical Weaver API / Worker combination with docker-proxy for sibling container execution.

  • Add captured stdout and stderr details in job log following CWL execution error when retrievable.

  • Document the WPS KVP/XML endpoint within the generated OpenAPI specification.

  • Disable auto-generation of request_options.yml file from corresponding empty example file and allow application to start if no such configuration was provided.

  • Remove every Python 2 backward compatibility references and operations.

  • Drop Python 2 and Python 3.5 support.

Fixes:
  • Target PyWPS-4.4 to resolve multiple invalid dependency requirements breaking installed packages over builtin Python packages and other compatibility fixes (see geopython/pywps #568).

  • Fix retrieval of database connexion to avoid warning of MongoClient opened before fork of processes.

  • Fix indirect dependency oauthlib missing from esgf-compute-api (cwt) package.

  • Fix inconsistent python reference resolution of builtin applications when executed locally and in tests (using virtual/conda environment) compared to within Weaver Docker image (using OS python).

  • Fix many typing definitions.

1.14.0 (2021-01-11)

Changes:
  • Add data input support for CWL Workflow step referring to WPS-3 Process.

  • Add documentation example references to Application Package and Process Deploy/Execute repositories.

  • Add parsing of providers in wps_processes.yml to directly register remote WPS providers that will dynamically fetch underlying WPS processes, instead of static per-service processes stored locally.

  • Add field visible to wps_processes.yml entries to allow directly defining the registered processes visibility.

  • Adjust response of remote provider processes to return the same format as local processes.

Fixes:
  • Fix stdout/stderr log file not permitted directly within CWL Workflow (must be inside intermediate steps).

  • Fix missing S3 bucket location constraint within unittests.

1.13.1 (2020-07-17)

Changes:
  • No change.

Fixes:
  • Create an stdout.log or stderr.log file in case cwltool hasn’t created it.

1.13.0 (2020-07-15)

Changes:
  • Add AWS S3 bucket support for process input reference files.

  • Add weaver.wps_output_s3_bucket setting to upload results to AWS S3 bucket instead of local directory.

  • Add weaver.wps_output_s3_region setting to allow override parameter extracted from AWS profile otherwise.

  • Add more documentation about supported file reference schemes.

  • Add documentation references to ESGF-CWT Compute API.

  • Add conditional input file reference fetching (depending on ADES/EMS, process type from CWL hints) to take advantage of request-options and all supported scheme formats by Weaver, instead of relying on PyWPS and/or CWL wherever how far downstream the URL reference was reaching.

Fixes:
  • Adjust some docstrings to better indicate raised errors.

  • Adjust weaver.processes.wps_package.WpsPackage to use its internal logger when running the process in order to preserve log entries under its job execution. They were otherwise lost over time across all process executions.

1.12.0 (2020-07-03)

Changes:
  • Add multiple CWL ESGF processes and workflows, namely SubsetNASAESGF, SubsetNASAESGF and many more.

  • Add tests for ESGF processes and workflows.

  • Add documentation for ESGF-CWTRequirement processes.

  • Add file2string_array and metalink2netcdf builtins.

  • Add esgf_process Wps1Process extension, to handle ESGF-CWTRequirement processes and workflows.

Fixes:
  • Reset MongoDatabase connection when we are in a forked process.

1.11.0 (2020-07-02)

Changes:
  • Generate Weaver OpenAPI specification for readthedocs publication.

  • Add some sections for documentation (#61).

  • Add support of documentation RST file redirection to generated HTML for reference resolution in both Github source and Readthedocs served pages.

  • Improve documentation links, ReadTheDocs format and TOC references.

  • Avoid logging stdout/stderr in workflows.

  • Add tests to make sure processes stdout/stderr are logged.

  • Remove Python 2.7 version as not officially supported.

  • Move and update WPS status location and status check functions into weaver.wps module.

Fixes:
  • Fix reported WPS status location to handle when starting with / although not representing an absolute path.

1.10.1 (2020-06-03)

Changes:
  • No change.

Fixes:
  • Pin celery==4.4.2 to avoid import error on missing futures.utils called internally in following versions.

1.10.0 (2020-06-03)

Changes:
  • Add support of value-typed metadata fields for process description.

  • Enforce rel field when specifying an href JSON link to match corresponding XML requirement.

Fixes:
  • Add more examples of supported WPS endpoint metadata (fixes #84).

1.9.0 (2020-06-01)

Changes:
  • Add weaver.wps_workdir configuration setting to define the location where the underlying cwltool application should be executed under. This can allow more control over the scope of the mounted volumes for Application Package running a docker image.

  • Add mapping of WPS results from the Job’s UUID to generated PyWPS UUID for outputs, status and log locations.

  • Add experimental configuration settings weaver.cwl_euid and weaver.cwl_egid to provide effective user/group identifiers to employ when running the CWL Application Package. Using these require good control of the directory and process I/O locations as invalid permissions could break a previously working job execution.

  • Add more logging configuration and apply them to cwltool before execution of Application Package.

  • Enforce no_match_user=False and no_read_only=False of cwltool’s RuntimeContext to ensure that docker application is executed with same user as weaver and that process input files are not modified inplace (readonly) where potentially inaccessible (according to settings). Definition of CWL package will need to add InitialWorkDirRequirement as per defined by reference specification to stage those files if they need to be accessed with write permissions (see: example). Addresses some issues listed in #155.

  • Enforce removal of some invalid CWL hints/requirements that would break the behaviour offered by Weaver.

  • Use weaver.request_options for WPS GetCapabilities and WPS Check Status requests under the running job.

  • Change default DOCKER_REPO value defined in Makefile to point to reference mentioned in README.md and considered as official deployment location.

  • Add application/x-cwl MIME-type supported with updated EDAM 1.24 ontology.

  • Add application/x-yaml MIME-type to known formats.

  • Add application/x-tar and application/tar+gzip MIME-type (not official) but resolved as synonym application/gzip (official) to preserve compressed file support during CWL format validation.

Fixes:
  • Set get_cwl_file_format default argument must_exist=True instead of False to retrieve original default behaviour of the function. Since CWL usually doesn’t need to add File.format field when no corresponding reference actually exists, this default also makes more sense.

1.8.1 (2020-05-22)

Changes:
  • Add Travis-CI smoke test of built docker images for early detection of invalid setup or breaking code to boot them.

  • Add Travis-CI checks for imports. This check was not validated previously although available.

  • Adjust weaver.ini.example to reflect working demo server configuration (employed by smoke test).

  • Move weaver web application to weaver.app to reduce chances of breaking setup.py installation from import errors due to weaver dependencies not yet installed. Redirect to new location makes this change transparent when loaded with the usual weaver.ini configuration.

Fixes:
  • Fix base docker image to install Python 3 development dependencies in order to compile requirements with expected environment Python version. Package python-dev for Python 2 was being installed instead.

  • Fix failing docker image boot due to incorrectly placed yaml import during setup installation.

  • Fix imports according to Makefile targets check-imports and fix-imports.

  • Fix parsing of PyWPS metadata to correctly employ values provided by weaver.ini.

1.8.0 (2020-05-21)

Changes:
  • Modify weaver.utils.request_retry to weaver.utils.request_extra to include more requests functionality and reuse it across the whole code base.

  • Add requests_extra SSL verification option using specific URL regex(es) matches from configuration settings.

  • Add file:// transport scheme support directly to utility requests_extra to handle local file paths.

  • Add file weaver.request_options INI configuration setting to specify per-request method/URL options.

  • Add requests_extra support of Retry-After response header (if any available on 429 status) which indicates how long to wait until next request to avoid automatically defined response right after.

  • Add weaver.wps_workdir configuration setting with allow setting corresponding pywps.workdir directory.

Fixes:
  • Modify Dockerfile-manager to run web application using pserve as gunicorn doesn’t correctly handles worker options anymore when loaded form weaver.ini with --paste argument. Also simplifies the command which already required multiple patches such as reapplying the host/port binding from INI file.

  • Fix handling of Literal Data I/O type when retrieved from OWSLib.wps object with remote WPS XML body.

  • Adjust make start target to use new make install-run target which installs the dependencies and package in edition mode so that configuration files present locally can be employed for running the application. Previously, one would have to move their configurations to the site-package install location of the active Python.

  • Fix celery>4.2 not found because of application path modification.

  • Fix invalid handling of wps_processes.yml reference in weaver.ini when specified as relative path to configuration directory.

  • Fix handling of WPS<->CWL I/O merge of data_format field against supported_formats with pywps>=4.2.4.

  • Fix installation of yaml-related packages for Python 2 backward compatibility.

1.7.0 (2020-05-15)

Changes:
  • Add additional status log for EOImage input modification with OpenSearch during process execution.

  • Add captured stderr/stdout logging of underlying CWL application being executed to resulting Job logs (addresses first step of #131).

  • Use weaver.utils.request_retry in even more places and extend convenience arguments offered by it to adapt it to specific use cases.

Fixes:
  • Fix handling of WPS-REST output matching a JSON file for multiple-output format specified with a relative local path as specified by job output location. Only remote HTTP references where correctly parsed. Also avoid failing the job if the reference JSON parsing fails. It will simply return the original reference URL in this case without expanded data (relates to #25).

  • Fix CWL job logs to be timezone aware, just like most other logs that will report UTC time.

  • Fix JSON response parsing of remote provider processes.

  • Fix parsing of CWL ordered parsing when I/O is specified as shorthand "<id>":"<type>" directly under the inputs or outputs dictionary instead of extended JSON object variant such as {"input": {"type:" "<type>", "format": [...]}} (fixes #137).

1.6.0 (2020-05-07)

Changes:
  • Reuse weaver.utils.request_retry function across a few locations that where essentially reimplementing the core functionality.

  • Add even more failure-permissive request attempts when validating a MIME-type against IANA website.

  • Add auto-resolution of common extensions known under PyWPS as well as employing their specific encoding.

  • Add geotiff format type support via PyWPS (#100).

  • Make WPS status check more resilient to failing WPS outputs location not found in case the directory path can be resolved to a valid local file representing the XML status (i.e.: don’t depend as much on the HTTP WPS output route).

  • Ensure backward support of generic/default text/plain I/O when extracted from a referenced WPS-1/2 XML remote process which provides insufficient format details. For CWL output generated from it, replace the glob pattern to match anything (<id>.*) instead of <id>.txt extracted from text/plain to simulate MIME-type as */*. Issue log warning message for future use cases.

Fixes:
  • Fix invalid AllowedValue parsing when using LiteralData inputs that resulted in AnyValue being parsed as a "None" string. This was transparent in case of string inputs and breaking for other types like integer when they attempted conversion.

  • Fix erroneous Metadata keywords passed down to owslib.wps.Metadata objects in case of more verbose detailed not allowed by this implementation.

  • Fix parsing of explicitly-typed optional array CWL I/O notation that was not considered (i.e.: using type as list with additional "null" instead of type: "<type>?" shorthand).

  • Fix parsing of MIME-type from format field to exclude additional parameters (e.g.: ; charset=UTF-8 for remote IANA validation.

1.5.1 (2020-03-26)

Changes:
  • Add unittest of utility function fetch_file.

  • Split some unittest utility functions to allow more reuse.

Fixes:
  • Fix invalid retry parameter not handled automatically by request.

1.5.0 (2020-03-25)

Changes:
  • Adjust incorrectly parsed href file reference as WPS complex input which resulted in failing location retrieval.

  • Partially address unnecessary fetch of file that has to be passed down to CWL, which will in turn request the file as required. Need update from PyWPS to resolve completely (#91, geopython/pywps#526).

  • Adjust WPS output results to use relative HTTP path in order to recompose the output URL if server settings change.

  • Support WPS output results as value (WPS literal data). Everything was considered an href file beforehand.

  • Add additional timeout and retry during fetching of remote file for process jsonarray2netcdf to avoid unnecessary failures during edge case connexion problems.

  • Add support of title and version field of builtin processes.

Fixes:
  • Patch builtin process execution failing since cwltool 2.x update.

  • Avoid long fetch operation using streamed request that defaulted to chuck size of 1. Now, we use an appropriate size according to available memory.

1.4.0 (2020-03-18)

Changes:
  • Update owslib to 0.19.2

  • Drop support for python 3.5

1.3.0 (2020-03-10)

Changes:
  • Provide a way to override the external URL reported by WPS-1/2 and WPS-REST via configuration settings allowing for more advanced server-side results in response bodies.

1.2.0 (2020-03-06)

Changes:
  • Add WPS languages for other wps requests types: DescribeProcess and GetCapabilities.

Fixes:
  • Fix a bug where the validation of OneOf items was casting the value to the first valid possibility.

1.1.0 (2020-02-17)

Changes:
  • Simplify docker image generation and make base/manager/worker variants all available under the same docker repo docker-registry.crim.ca/ogc/weaver with different tags (#5).

  • Add planned future support of Accept-Language header for WPS-1/2 (geopython/OWSLib 0.20.0) (#74).

  • Improved job logs update with message and progress to allow better tracking of internal operations and/or problems.

  • Allow WPS builtin process jsonarray2netcdf to fetch a remote file.

  • Change doc to point to DockerHub pavics/weaver images.

  • Adjust CI rule long-lasting failures until it gets patched by original reference (gitleaks-actions#3).

Fixes:
  • Fix readthedocs documentation generation.

  • Fix .travis docker image build condition.

  • Fix geopython/OWSLib>=0.19.1 requirement for Python 3.8 support (#62).

  • Fix job update filling due to status location incorrectly resolved according to configured PyWPS output path.

1.0.0 (2020-01-28)

New Features:
  • Add notification_email field to Job datatype that stores an encrypted email (according to settings) when provided in the job submission body (#44).

  • Add ability to filter jobs with notification_email query parameter (#44).

  • Add jobs statistics grouping by specific fields using comma-separated list groups query parameter (#46).

  • Add some tests to evaluate new job search methods / grouping results and responses (#44, #46).

  • Add handling of multiple CWL field format for File type.

  • Add missing ontology reference support for CWL field format by defaulting to IANA namespace.

  • Add support for I/O array of enum (ie: multiple values of AllowedValues for a given input) (#30).

  • Add support of label synonym as title for inputs and process description (CWL specifying a label will set it in WPS process) (#31)

  • Add support of input minOccurs and maxOccurs as int while maintaining str support (#14).

  • Add conformance route with implementation links (#53).

  • Add additional landing page link details (#54).

  • Add weaver.wps_restapi.colander_extras.DropableNoneSchema to auto-handle some schema JSON deserialization.

  • Add weaver.wps_restapi.colander_extras.VariableMappingSchema to auto-handle some schema JSON deserialization.

  • Add more functional tests (#11, #17).

Changes:
  • Use bump2version and move all config under setup.cfg.

  • Remove enforced text/plain for CWL File when missing format field.

  • Replace bubbling up of too verbose unhandled exceptions (500 Internal Server Error) by summary message and additional internal logging for debugging the cause using an utility exception log decorator.

  • Use the same exception log decorator to simplify function definitions when HTTP exceptions are already handled.

  • Make null reference a singleton so that multiple instantiation calls all refer to the same instance and produce the expected behaviour of <x> is null instead of hard-to-identify errors because of english syntax.

  • Remove unused function weaver.utils.replace_caps_url and corresponding tests.

  • Remove weaver.processes.utils.jsonify_value duplicated by weaver.processes.wps_package.complex2json.

  • Use more JSON body schema validation using API schema definitions deserialization defined by weaver.datatype.

  • Enforce builtin processes registration on startup to receive applicable updates.

  • Provide 2 separate docker images for Weaver manager and worker, corresponding to the EMS/ADES API and the celery job runner respectively.

  • Update Apache license.

Fixes:
  • Adjust some typing definitions incorrectly specified.

  • Fix some failing functionality tests (#11, #17).

  • Fix I/O field ordering preserved as specified in payload or loaded reference file.

  • Fix setting minOccurs=0 when a default is specified in the corresponding CWL I/O (#17, #25).

  • Fix incorrectly overridden maxOccurs="unbounded" by maxOccurs="1" when a partial array input definition is specified without explicit maxOccurs in WPS payload (#17, #25).

  • Fix case where omitted format[s] in both CWL and WPS deploy bodies generated a process description with complex I/O (file) without required formats field. Default text/plain format is now automatically added.

  • Fix case where format[s] lists between CWL and WPS where incorrectly merged.

  • Fix metadata field within a WPS I/O incorrectly parsed when provided by a WPS-1/2 XML process definition.

  • Fix invalid JSON response formatting on failing schema validation of process deployment body.

  • Fix docker images to support pserve when using gunicorn>=20.x dropping support of --paste config feature.

  • Fix multiple Python 2/3 compatibility issues.

0.2.2 (2019-05-31)

  • Support notification email subject template.

0.2.1 (2019-05-29)

  • Add per-process email notification template.

0.2.0 (2019-03-26)

  • Fixes to handle invalid key characters "$" and "." during CWL package read/write operations to database.

  • Fixes some invalid CWL package generation from WPS-1 references.

  • More cases handled for WPS-1 to CWL WPS1Requirement conversion (AllowedValues, Default, SupportedFormats, minOccurs, maxOccurs).

  • Add file format validation to generated CWL package from WPS-1 MIME-types.

  • Allow auto-deployment of WPS-REST processes from WPS-1 references specified by configuration.

  • Add many deployment and execution validation tests for WPS1Requirement.

  • Add builtin application packages support for common operations.

0.1.3 (2019-03-07)

  • Add useful Makefile targets for deployment.

  • Add badges indications in README.rst for tracking from repo landing page.

  • Fix security issue of PyYAML requirement.

  • Fix some execution issues for Wps1Process.

  • Fix some API schema erroneous definitions.

  • Additional logging of unhandled errors.

  • Improve some typing definitions.

0.1.2 (2019-03-05)

  • Introduce WPS1Requirement and corresponding Wps1Process to run a WPS-1 process under CWL.

  • Remove mongodb requirement, assume it is running on an external service or docker image.

  • Add some typing definitions.

  • Fix some problematic imports.

  • Fix some PEP8 issues and PyCharm warnings.

0.1.1 (2019-03-04)

  • Modify Dockerfile to use lighter debian:latest instead of birdhouse/bird-base:latest.

  • Modify Dockerfile to reduce build time by reusing built image layers (requirements installation mostly).

  • Make some buildout dependencies optional to also reduce build time and image size.

  • Some additional striping of deprecated or invalid items from Twitcher.

0.1.0 (2019-02-26)

  • Initial Release. Based off Twitcher tag ogc-0.4.7.

FAQ

This section present some commonly encountered use-cases and basic solutions regarding ADES/EMS operation or more specifically related to CWL specification.

How to specify the Docker image reference?

In most situations, the CommandLineTool process will need to run a Docker image. Doing so is as simple as adding the DockerRequirement (reference) as follows to the Application Package definition:

{
  "cwlVersion": "v1.0",
  "requirements": {
    "DockerRequirement": {
      "dockerPull": "<docker-url>"
    }
  },
  "inputs": ["<...>"],
  "outputs": ["<...>"],
}

Note

The Docker image reference must be publicly accessible to allow CWL to pull it. Alternatively, a private Docker reference can be used if the image is locally available. The process will fail to execute if it cannot resolve the reference.

The Application Package can be provided during process deployment. Please refer to below references for more details.

Fixing permission error on input files

Some processes expect their inputs to be writable (e.g.: ZIP files). When running an Application Package based on a Docker image, Weaver mounts the input files as volumes in read-only mode for security reasons. This causes these processes to immediately fail as the running user cannot override nor write temporary files in the same directory (where the volume was mounted to), as it is marked with read permissions.

To resolve this issue, the application developer should add the InitialWorkDirRequirement (reference, example) to his CWL package definition. This tells CWL to stage the files into the Docker container into the running directory where the user will be allowed to generate outputs, and therefore, also allow edition of the inputs or generation of temporary files as when unpacking a compressed file.

As example, the CWL definition could be similar to the following:

{
  "cwlVersion": "v1.0",
  "class": "CommandLineTool",
  "requirements": {
    "DockerRequirement": {
      "dockerPull": "<docker-url>"
    },
    "InitialWorkDirRequirement": {
      "listing": [{
         "entry": "$(inputs.input_file)",
         "writable": true
        }
      ]
    }
  },
  "arguments": ["$(runtime.outdir)"],
  "inputs": {
    "input_file": {
    "type": "File"
  }
}

Note that $(inputs.input_file) within InitialWorkDirRequirement tells which input to resolve for staging using the "writable": True parameter. All files listed there will be mounted with write permissions into working runtime directory of the executed Docker container.

Where can I find references to CWL specification and examples?

There exist multiple sources, but official ones provided below have a create amount of examples and are being continuously improved by the developers (including being updated according to changes).

Glossary

ADES
Application Deployment and Execution Service
See Processes section for details, as well as EMS for alternative operation mode.
Application Package

General term that refers to “what and how the :term:`Process` will execute”. Application Packages provide the core details about the execution methodology of the underlying operation the Process provides, and are therefore always contained within a Process definition. This is more specifically represented by a CWL specification in the case of Weaver implementation, but could technically be defined by another similar approach. See Application Package section for all relevant details.

AWS

Amazon Web Services

CWL
Representation of the internal Application Package of the Process to provide execution methodology of the referenced Docker image or other supported definitions. See application-package section for further details.
Docker

Containerized and isolated environment platform that allows all required dependencies of an application or software to be packaged in a single image in order to correctly execute the virtualized application.

EDAM

Ontology that regroups multiple definitions, amongst which Weaver looks up some of its known and supported MIME-types (EDAM media types) when resolving file formats. It is used as extension to IANA media types by providing additional formats that are more specifics to some data domains.

EMS
Execution Management Service
See Processes section for details. Alternative mode is ADES, which can be selected as defined by the appropriate Configuration parameter.
ESGF

Earth System Grid Federation

ESGF-CWT

ESGF Compute API

HREF
Hyperlink Reference
Often shortened to simply reference. Represents either a locally or remotely accessible item, such as a file or a Process depending on context, that uses explicit <protocol>://<host/path> representation to define its location. See also File Reference Types for typical examples.
I/O

Inputs and/or Outputs of CWL and/or WPS depending on context.

IANA

Ontology that regroups multiple definitions, amongst which Weaver looks up most of its known and supported MIME-types (IANA media types) when resolving file formats.

Job

Definition of a Process execution state with applicable operation metadata.

JSON
JavaScript Object Notation
Default data representation of all objects contained in the application or for their creation.
MIME-types
Multipurpose Internet Mail Extensions
Format representation of the referenced element, often represented by IANA or EDAM ontologies.
OGC

Open Geospatial Consortium

OGC API - Processes

The new API that defines JSON REST-binding representation of WPS Process collection.

OpenSearch

Protocol of lookup and retrieval of remotely stored files. Please refer to OpenSearch Data Source for details.

Process

Entity that describes the required inputs, produced outputs, and any applicable metadata for the execution of the defined script, calculation, or operation.

S3

Simple Storage Service (AWS S3), bucket file storage.

WKT

Well-Known Text geometry representation.

WPS
Web Processing Service.
From a formal standpoint, this is the previous OGC standard iteration that was employed prior to OGC API - Processes to represent a server that host one or more Process for execution. When compared against CWL context or generally across Weaver documentation and code, this term refers to attributes that are specific to typical Process description, in contrast to specialized attributes introduced by other concepts, such as for example CWL-specific implementation details.
XML
Extensible Markup Language
Alternative representation of some data object provided by the application. Requires appropriate Accept header to return this format. See OpenAPI Specification for details.