Weaver

Implementations

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 OGC-API flavored Execution Management Service (EMS) that allows the execution of workflows chaining various applications and Web Processing Services inputs and outputs. Remote execution is deferred by the EMS to one or many Application, Deployment and Execution Service (ADES) or remote service providers, and employs Common Workflow Language (CWL) configurations to define an OGC Application Package deployed for each process.

dependencies

Requires Python 3.7+ Libraries.io Dependencies Status PyUp 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 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 OGC Application Package with received inputs from a WPS request to expose output results for a following ADES in a EMS workflow execution chain.

Weaver extends OGC API - Processes by providing additional functionalities such as more detailed job logs endpoints, adding more process management and search request options than required by the standard, and supporting remote providers registration for dynamic process definitions, 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, an ADES or an HYBRID of both according to its configuration. For more details, see Configuration and Documentation sections.

Features Preview

Following videos present some of the features and potential capabilities of servicing and executing processes offered by Application, Deployment and Execution Service (ADES) and Execution Management Service (EMS) instances like Weaver.

Keywords: Big Data, software architecture, Earth Observation, satellite data, processing, climate change, machine learning, climate services.

Applications

The video shares the fundamental ideas behind the architecture, illustrates how application stores for Earth Observation data processing can evolve, and illustrates the advantages with applications based on machine learning.

Watch the Application video on YouTube
Watch the Application video: http://www.youtube.com/watch?v=v=no3REyoxE3

Platform

The video shares the fundamental ideas behind the architecture, illustrates how platform managers can benefit from application stores, and shows the potential for multidisciplinary workflows in thematic platforms.

Watch the Platform video on YouTube
Watch the Platform video: http://www.youtube.com/watch?v=v=QkdDFGEfIAY

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 the operational mode of Weaver (EMS/ADES/HYBRID) 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 from the 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. Findings and recommendations are presented in the OGC Testbed-16: Data Access and Processing Engineering Report.

Videos and more functionalities were introduced in Weaver following OGC Earth Observation Applications Pilot. Corresponding developments are reported in the OGC Earth Observation Applications Pilot: CRIM Engineering Report.

Weaver has been used to participate in interoperability testing effort that lead to OGC Best Practice for Earth Observation Application Package technical report. This resulted, along with previous efforts, in the definition of OGC API - Processes - Part 2: Deploy, Replace, Undeploy (DRU) extension backed by validated test cases using Common Workflow Language (CWL) as the representation method for the deployment and execution of OGC Application Package close to the data.

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

Weaver is implemented in Python with the Pyramid web framework. It is part of PAVICS and Birdhouse ecosystems and is available within the birdhouse-deploy server stack.

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 Weaver sections for following steps.

Database Migration

New in version 4.3.

Previous versions of Weaver did not require any specific version of MongoDB. Features were working using version as early as mongo==3.4 if not even older. Due to more recent search capabilities, performance improvements and security fixes, minimum requirement of mongo==5.0 has been made mandatory.

In terms of data itself, there should be no difference, unless more advanced usage (e.g.: Replica Sets) were configured on your side. See relevant MongoDB official documentation as needed in this case. Otherwise, employed mongodb instance simply needs to be updated with the relevant versions.

To simplify to process, the following procedure is recommended to avoid installing MongoDB libraries. Assuming the current version is 3.4, below operations must be executed iteratively for every migration step of versions 3.6, 4.0, 4.2, 4.4 and 5.0, where VERSION is the new version above the current one.

docker run --name mongo -v <DB_DATA_PATH>:/data/db -d mongo:<VERSION>
docker exec -ti mongo mongo

# in docker, should answer with: { "ok" : 1 }
db.adminCommand( { setFeatureCompatibilityVersion: "<VERSION>" } )
exit

# back in shell
docker stop mongo && docker rm mongo

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: http://localhost:4001)

    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.schema_url = <url>
    (default: ${weaver.url}/json#/definitions)

    Defines the base URL of schemas to be reported in responses.

    When not provided, the running Web Application instance OpenAPI JSON path will be employed to refer to the schema definitions section. The configuration setting is available to override this endpoint by another static URL location where the corresponding schemas can be found if desired.

New in version 4.0.

  • weaver.cwl_euid = <int> [int, experimental]
    (default: None, auto-resolved by CWL with effective machine user)

    Define the effective machine user ID to be used for running the Application Package.

New in version 1.9.

  • weaver.cwl_egid = <int> [int, experimental]
    (default: None, auto-resolved by CWL with the group of the effective user)

    Define the effective machine group ID to be used for running the Application Package.

New in version 1.9.

  • weaver.wps = true|false [bool-like]
    (default: true)

    Enables the WPS-1/2 endpoint.

See also

WPS 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-name>
    (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.

  • weaver.wps_output_s3_region = <s3-region-name>
    (default: None, any S3 Region amongst mypy_boto3_s3.literals.RegionName)

    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.

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

    Location where WPS outputs (results from Job) 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.

Changed in version 4.3: The output directory could be nested under a contextual directory if requested during Job submission. See Outputs Location and below weaver.wps_output_context parameter for more details.

  • weaver.wps_output_context = <sub-directory-path>
    (default: None)

    Default sub-directory hierarchy location to nest WPS outputs (Job results) under.

    If defined, this parameter is used as substitute context when X-WPS-Output-Context header is omitted. When not defined, X-WPS-Output-Context header can still take effect, but omitting it will store results directly under weaver.wps_output_dir instead of default context location.

New in version 4.3.

Changed in version 4.27: Nesting of the context directory from X-WPS-Output-Context or weaver.wps_output_dir will also take effect when storing Job results under S3 when weaver.wps_output_s3_bucket and weaver.wps_output_s3_region are also defined. Previous versions applied the context directory only for local storage using the other WPS output settings.

See also

See Outputs Location for more details about this feature and implications of this setting.

  • 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.

Note

The resulting weaver.wps_output_url endpoint, whether directly provided or indirectly resolved by weaver.url and weaver.wps_output_path will not be served by Weaver itself. This location is returned for reference in API responses, but it is up to the infrastructure that hosts Weaver service to make this location available online as deemed necessary.

  • 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 [bool-like]
    (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) [str]

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

    Defines configuration of email notification functionality on Job status milestones.

    Encryption settings as well as custom email template locations are available. The Default Notification Email Mako Template is employed if none is provided or when specified template files or directory cannot be resolved.

    When looking up for templates within weaver.wps_email_notify_template_dir, the following resolution order is followed to attempt matching files. The first one that is found will be employed for the notification email.

    1. file {TEMPLATE_DIR}/{PROCESS_ID}/{STATUS}.mako used for a specific Process and Job status
    2. file {TEMPLATE_DIR}/{PROCESS_ID}.mako used for a specific Process but any Job status
    3. file {TEMPLATE_DIR}/{weaver.wps_email_notify_template_default} used for any combination if specified
    4. file {TEMPLATE_DIR}/default.mako used for any combination if an alternate default name was not specified

    Email notifications are sent only when corresponding Job status milestones are reached and when email(s) were provided in the Execute request body. Emails will not be sent if the request body did not include a subscription to those notifications, even if the templates were configured.

See also

See Notification Subscribers for more details.

New in version 4.15.

Changed in version 4.34.

New in version 4.15.

Changed in version 4.30: Renamed from weaver.exec_sync_max_wait to weaver.execute_sync_max_wait.

Configuration of Celery with MongoDB Backend

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 employed. 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.

Warning

In order to support synchronous execution, the RESULT_BACKEND setting MUST be defined.

Configuration of AWS S3 Buckets

Any AWS S3 Bucket provided to 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 AWS Credentials 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 with weaver.wps_output_s3_bucket setting as presented in the previous section.

The S3 file and directory references for input and output in Weaver are expected to be formatted as one of the methods described in AWS S3 Bucket Access Methods (more details about supported formats in AWS S3 Bucket References). The easiest and most common approach is to use a reference using the s3:// scheme as follows:

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

This implicitly tells Weaver to employ the specified S3 bucket it was configured with as well as the automatically retrieved location (using the region from the default profile) in the AWS Configuration of the application.

Alternatively, the reference can be provided as input more explicitly with any of the supported AWS S3 Bucket References. For example, the AWS S3 link could be specified as follows.

https://s3.{Region}.amazonaws.com/{Bucket}/{file-key}

In this situation, Weaver will parse it as equivalent to the prior shorthand s3:// reference format, by substituting any appropriate details retrieved from the AWS Configuration as needed to form the above HTTP URL variant. For example, an alternative Region from the default could be specified. After resolution, Weaver will still attempt to fetch the file as standard HTTP reference by following the relevant AWS S3 Bucket Access Methods. In each case, read access should be granted accordingly to the corresponding bucket, files and/or directories such that Weaver can stage them locally. For produced outputs, the write access must be granted.

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 path elements. For example, if weaver.wps_output_s3_bucket is defined in the configuration, 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}.amazonaws.com/{Bucket}/{WPS-UUID}/{output-id.ext}

Region ::= weaver.wps_output_s3_region
Bucket ::= weaver.wps_output_s3_bucket

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.

Note

The value of file-key also applies for Directory Type references.

Configuration of Data Sources

A typical Data Source file is presented below. This sample is also provided in data_sources.yml.example.

# List Data-Source known locations such that Weaver configured in EMS mode can dispatch processes execution to
# corresponding ADES when input data references match the provided locations.
#
# For the expected Schema Definition, see module:
#   weaver.processes.sources
#
# NOTE:
#   This configuration can be formatted in YAML or JSON at your convenience.
#
example:
  # since this is not the default (see localhost),
  # only data matching that location will be forwarded to corresponding ADES
  netloc: "example-data.com"
  ades: "https://example.com/ADES"

localhost:
  # default is define here, so any unmatched data-source location will fallback to this ADES
  # since that default is 'localhost', default in this case will indicate "run it locally"
  # another ADES location could be set as default to dispatch unknown data-source executions to that specific instance
  netloc: "localhost"
  ades: "https://localhost:4001"
  default: true

opensearchdefault:
  # data-sources that require OpenSearch capabilities require more configuration details
  # this applies to processes that employ OpenSearch query definitions to define process inputs
  # see details and examples:
  #   https://pavics-weaver.readthedocs.io/en/latest/processes.html#opensearch-data-source
  #   tests/json_examples/opensearch_process.json
  #   tests/json_examples/eoimage_inputs_example.json
  ades: "http://localhost:4001"
  collection_id: ""
  accept_schemes: ["http", "https"]
  rootdir: ""
  osdd_url: "http://example.com/opensearchdescription.xml"

Both JSON and YAML are equivalent and supported. The data_sources.yml file is generated by default in the configuration folder based on the default example (if missing). Custom configurations can be placed in the expected location or can also be provide with an alternative path using the Weaver.data_sources configuration setting.

Note

As presented in the above example, the Data Source file can also refer to OpenSearch Data Source which imply additional pre-processing steps.

See also

More details about the implication of Data Source are provided in ADES dispatching using Data Sources.

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 DescribeProcess response), or a group of processes under a common WPS server to iteratively register, using a GetCapabilities 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: 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.

  • weaver.wps_processes_file = <file-path>
    (default: WEAVER_DEFAULT_WPS_PROCESSES_CONFIG located in WEAVER_CONFIG_DIR)

    Defines a custom YAML file corresponding to wps_processes.yml.example schema to pre-load WPS processes and/or providers for registration at application startup.

    The value defined by 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). The default value is employed if the setting is not defined at all.

Configuration of CWL Processes

New in version 4.19.

Although Weaver supports Deployment and dynamic management of Process definitions while the web application is running, it is sometime more convenient for service providers to offer a set of predefined Application Package definitions. In order to automatically register such definitions (or update them if changed), without having to repeat any deployment requests after the application was started, it is possible to employ the configuration setting weaver.cwl_processes_dir. Registration of a Process using this approach will result in an identical definition as if it was Deployed using API requests or using the Weaver CLI and Client interfaces.

  • weaver.cwl_processes_dir = <dir-path>
    (default: WEAVER_CONFIG_DIR)

    Defines the root directory where to recursively and alphabetically load any CWL file to deploy the corresponding Process definitions. Files at higher levels are loaded first before moving down into lower directories of the structure.

    Any failed deployment from a seemingly valid CWL will be logged with the corresponding error message. Loading will proceed by ignoring failing cases according to weaver.cwl_processes_register_error setting. The number of successful Process deployments will also be reported if any should occur.

    The value defined by 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). If no CWL file could 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.cwl_processes_dir as undefined (i.e.: nothing after = in weaver.ini). The default value is employed if the setting is not defined at all.

Note

When registering processes using CWL, it is mandatory for those definitions to provide an id within the file along other CWL details to let Weaver know which Process reference to use for deployment.

Warning

If a Process depends on another definition, such as in the case of a Workflow definition, all dependencies must be registered prior to this Process. Consider naming your CWL files to take advantage of loading order to resolve such situations.

  • weaver.cwl_processes_register_error = true|false [bool]
    (default: false, ignore failures)

    Indicate if Weaver should ignore failing Process deployments (when false), due to unsuccessful registration of CWL files found within any sub-directory of weaver.cwl_processes_dir path, or immediately fail (when true) when an issue is raised during Process deployment.

Configuration of Request Options

New in version 1.8.

It is possible to define Request Options that consist of additional arguments that will be passed down to weaver.utils.request_extra(), which essentially call a traditional request using requests module, but with extended handling capabilities such as caching, retrying, and file reference support. The specific parameters that are passed down for individual requests depend whether a match based on URL (optionally with regex rules) and method definitions can be found in the Request Options file. This file should be provided using the weaver.request_options configuration setting. Using this definition, it is possible to provide specific requests handling options, such as extended timeout, authentication arguments, SSL certification verification setting, etc. on a per-request basis, leave other requests unaffected and generally more secure.

See also

File request_options.yml.example provides more details and sample YAML format of the expected contents for Request Options feature.

See also

Please refer to weaver.utils.request_extra() documentation directly for supported parameters and capabilities.

  • weaver.request_options = <file-path>
    (default: None)

    Path of the Request Options definitions to employ.
  • weaver.ssl_verify = true|false [bool-like]
    (default: true)

    Toggle the SSL certificate verification across all requests.

Warning

It is NOT recommended to disable SSL verification across all requests for security reasons (avoid man-in-the-middle attacks). This is crucial for requests that involve any form of authentication, secured access or personal user data references. This should be employed only for quickly resolving issues during development. Consider fixing SSL certificates on problematic servers, or disable the verification on a per-request basis using Request Options for acceptable cases.

Configuration of Quotation Estimation

New in version 4.30.

Following parameters are relevant when using OGC API - Processes - Quotation extension. If this feature is not desired, simply provide weaver.quotation = false in the weaver.ini configuration file, and all corresponding functionalities, including API endpoints, will be disabled.

New in version 4.30.

New in version 4.30.

  • weaver.quotation_docker_username = <username> [str]

    Username to employ for authentication when retrieving the Docker image used as Quote Estimator.

    Only required if the Docker image is not accessible publicly or already provided through some other means when requested by the Docker daemon. Should be combined with weaver.quotation_docker_password.

    See Currency Conversion for more details on the feature.

New in version 4.30.

  • weaver.quotation_docker_password = <username> [str]

    Password to employ for authentication when retrieving the Docker image used as Quote Estimator.

    Only required if the Docker image is not accessible publicly or already provided through some other means when requested by the Docker daemon. Should be combined with weaver.quotation_docker_username.

    See Currency Conversion for more details on the feature.

New in version 4.30.

  • weaver.quotation_currency_default = <CURRENCY> [str]
    (default: USD)

    Currency code in ISO-4217 format used by default.

    It is up to the specified Quote Estimator algorithm defined by weaver.quotation_docker_image and employed by the various Process to ensure that the returned Quote Estimation cost makes sense according to the specified default currency.

    See Currency Conversion for more details on the feature.

New in version 4.30.

  • weaver.quotation_currency_converter = <converter> [str]

    Reference currency converter to employ for retrieving conversion rates.

    Valid values are:
    - custom

    In each case, requests will be attempted using weaver.quotation_currency_token to authenticate with the API. Request caching of 1 hour will be used by default to limit chances of rate-limiting, but converter-specific plans could block request at any moment depending on the amount of Quotation and Billing requests accomplished. In such case, the conversion will not be performed and will remain in the default currency.

    If a custom URL is desired, the weaver.quotation_currency_custom_url parameter should also be provided.

    If none is provided, conversion rates will not be applied and currencies will always use weaver.quotation_currency_default.

    See Quotation and Billing for more details on the feature.

New in version 4.30.

  • weaver.quotation_currency_custom_url = <URL> [str]

    Reference custom currency converter URL pattern to employ for retrieving conversion rates.

    This applies only when using weaver.quotation_currency_converter = custom

    The specified URL will be used to perform a GET request. This URL should contain the relevant query or path parameters to perform the request. Parameters can be specified using templating ({<param>}), with parameters names token, from, to and amount to perform the conversion. The query parameter token will be filled by weaver.quotation_currency_token, while remaining values will be provided based on the source and target currency conversion requirements. The response body should be in JSON with minimally the conversion result field located at the root. The same caching policy will be applied as for the other API references.

    If none is provided, conversion rates will not be applied and currencies will always use weaver.quotation_currency_default.

    See Quotation and Billing for more details on the feature.

New in version 4.30.

  • weaver.quotation_currency_token = <API access token> [str]

    Password to employ for authentication when retrieving the Docker image used as Quote Estimator.

    Only required if the Docker image is not accessible publicly or already provided through some other means when requested by the Docker daemon. Should be combined with weaver.quotation_docker_username.
    See Quotation and Billing for more details on the feature.

New in version 4.30.

Changed in version 4.30: Renamed from weaver.quote_sync_max_wait to weaver.quotation_sync_max_wait.

Configuration of File Vault

New in version 4.9.

Configuration of the Vault is required in order to obtain access to its functionalities and to enable its API endpoints. This feature is notably employed to push local files to a remote Weaver instance when using the Weaver CLI and Client utilities, in order to use them for the Job execution. Please refer to below references for more details.

  • weaver.vault = true|false [bool-like]
    (default: true)

    Toggles the Vault feature.
  • weaver.vault_dir = <dir-path>
    (default: /tmp/vault)

    Defines the default location where to write files uploaded to the Vault.

    If the directory does not exist, it is created on demand by the feature making use of it.

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

Using WPS Application

See Tutorial.

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 OGC API - Processes (WPS-REST bindings) 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, Application Package and FAQ sections.

The full OpenAPI Specification is also available for request details to target a Running Weaver service. Alternatively, the Weaver CLI and Client can also be employed to facilitate interactions with a Weaver service.

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 OGC API - Processes (WPS-REST, WPS-T, WPS-3) specification. When an OGC API - Processes description is deployed in Weaver using an URL reference to an WPS-1/2 process through the use of a Remote Applications requirement, Weaver parses and converts the XML or JSON body of the WPS response and registers the process locally. 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

OGC API - Processes (WPS-REST, WPS-T, WPS-3)

This Process type is the main component of Weaver. All other 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. The represented Process is aligned with OGC API - Processes specifications.

When deploying one such Process directly, it is expected to have a definition specified with a CWL Application Package, which provides resources about one of the described Typical CWL Package Definition.

This is most of the time employed to wrap operations packaged in a reference Docker image, but it can also wrap Remote Applications to be executed on another server (i.e.: ADES). 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 Correspondence between CWL and WPS fields section for more details.

Package as Literal Execution 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-literal-package"
    }
  },
  "executionUnit": [
    {
      "unit": {
        "cwlVersion": "v1.0",
        "class": "CommandLineTool",
        "inputs": ["<...>"],
        "outputs": ["<...>"],
        "<...>": "<...>"
      }
    }
  ]
}
Package as External Execution Unit Reference

In this situation, the CWL is provided indirectly using an external file reference which is expected to have contents describing the Application Package (as presented in the Package as Literal Execution Unit Block case). Because an external file is employed instead of embedding the package within the JSON HTTP request contents, it is possible to employ both JSON and YAML definitions.

An example is presented below:

{
  "processDescription": {
    "process": {
      "id": "my-process-reference-package"
    }
  },
  "executionUnit": [
    {
      "href": "https://remote-file-server.com/my-package.cwl"
    }
  ]
}

Where the referenced file hosted at "https://remote-file-server.com/my-package.cwl" could contain:

cwlVersion: "v1.0"
class: CommandLineTool
inputs:
  - "<...>"
outputs:
  - "<...>"
"<...>": "<...>"
ESGF-CWT

For ESGF-CWT processes, the ESGF-CWTRequirement hint must be used. For an example CWL using this definition, see Remote Applications section.

This kind of Process allows for remote Execution and Monitoring of a Job dispatched to an instance that implements ESGF Compute API part of the Earth System Grid Federation. Using Weaver, this Process automatically obtains an OGC API - Processes (WPS-REST, WPS-T, WPS-3) representation.

Workflow

Processes categorized as Workflow are very similar to OGC API - Processes (WPS-REST, WPS-T, WPS-3) 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 or HYBRID (see: Configuration Settings). This requirement is due to the nature of Workflow that chain processes that need to be dispatched to known remote ADES servers (see: Configuration of Data Sources and Workflow Step Operations) according to defined Data Source configuration.

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 Source. Each step’s job will then gradually be monitored from the relevant ADES until completion.

Upon successful intermediate result, the EMS (or HYBRID acting as such) will stage the data references locally to chain them to the following step. When the complete chain succeeds, the final results of the last step will be provided as Workflow output in the same manner as for atomic processes. In case of failure, the error will be indicated in the logs 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.

See also

Workflow Step Operations provides more details on each of the internal operations accomplished by individual step Process chained in a Workflow.

Remote Provider

A remote Provider corresponds to a service hosted remotely that provides similar or compatible (WPS-like) interfaces supported by Weaver. 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 its process capabilities (see GetCapabilities), Weaver will send the corresponding request using the reference URL from the registered Provider to access the remote server and reply with the parsed response, as if 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 to palliate the limited functionalities offered by the service. For instance, WPS-1 do not always offer Monitoring of a process execution (GetStatus) feature, and there is no extensive Job monitoring capabilities. Since Weaver effectively wraps the referenced Provider with its own endpoints, these features indirectly become employable through an extended OGC API - Processes interface. Similarly, although many WPS-1 offer XML-only responses, the parsing operation accomplished by Weaver makes theses services available as WPS-REST JSON endpoints with automatic conversion. On top of that, registering a remote Provider into Weaver allows the user to use it as a central hub to keep references to all his remotely accessible services and dispatch Job executions 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 until requested. When calling Process-specific requests (e.g.: DescribeProcess or Execute), Weaver will re-send the corresponding request (with appropriate interface conversion) 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 Process (which could become out-of-sync), while Remote Provider will dynamically update according to the re-fetched response from the remote service each time, always keeping the obtained description in sync with the remote Provider. If our example remote service was extended to have a third WPS process, it would immediately and transparently be reflected in GetCapabilities and DescribeProcess retrieved by Weaver on Providers-scoped requests without any change to the registered Provider definition. This would not be the case for the WPS-1/2 reference that would need a manual update (i.e.: 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 is provided by 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. Alternatively, the visibility can be directly provided within the body of the deploy request to skip this extra step. For specifying or updating visibility, please refer to corresponding POST {WEAVER_URL}/processes (Deploy) and PUT {WEAVER_URL}/processes/{processID}/visibility (Visibility) requests.

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 OGC API - Processes (WPS-REST, WPS-T, WPS-3) 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 side might not be perfectly mapped to the equivalent or adjusted OGC API - Processes (WPS-REST, WPS-T, WPS-3) interface, although this concerns mostly only new features such as Job status monitoring. For most traditional use cases, properties are mapped between the two interfaces, but it is recommended to use the OGC API - Processes (WPS-REST, WPS-T, WPS-3) one because of the added features.

See also

Please refer to Application Package chapter for any additional parameters that can be provided for specific types of Application Package and Process definitions.

Access registered processes (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/{processID} (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 request on wps_endpoint.

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

Changed in version 4.20.

With the addition of Process revisions (see Update Operation below), a registered Process specified only by {processID} will retrieve the latest revision of that Process. A specific older revision can be obtained by adding the tagged version in the path ({processID}:{version}) or adding the request query parameter version.

Using revisions provided through PUT and PATCH requests, it is also possible to list specific or all existing revisions of a given or multiple processes simultaneously using the revisions and version query parameters with the GET {WEAVER_URL}/processes (GetCapabilities) request.

Update, replace or remove an existing process (Update, Replace, Undeploy)

Since Weaver supports OGC API - Processes - Part 2: Deploy, Replace, Undeploy, it is able to remove a previously registered Process using the Deployment request. The undeploy operation consist of a DELETE request targeting the specific {WEAVER_URL}/processes/{processID} to be removed.

Note

The Process must be accessible by the user considering any visibility configuration to perform this step. See Register a new process (Deploy) section for details.

New in version 4.20.

Starting from version 4.20, a Process can be replaced or updated using respectively the PUT and PATCH requests onto the specific {WEAVER_URL}/processes/{processID} location of the reference to modify.

Note

The Process partial update operation (using PATCH) is specific to Weaver only. OGC API - Processes - Part 2: Deploy, Replace, Undeploy only mandates the definition of PUT request for full override of a Process.

When a Process is modified using the PATCH operation, only the new definitions need to be provided, and unspecified items are transferred over from the referenced Process (i.e.: the previous revision). Using either the PUT or PATCH requests, previous revisions can be referenced using two formats:

  • {processID}:{version} as request path parameters (instead of usual {processID} only)

  • {processID} in the request path combined with ?version={version} query parameter

Weaver employs MAJOR.MINOR.PATCH semantic versioning to maintain revisions of updated or replaced Process definitions. The next revision number to employ for update or replacement can either be provided explicitly in the request body using a version, or be omitted. When omitted, the next revision will be guessed automatically based on the previous available revision according to the level of changes required. In either cases, the resolved version will have to be available and respect the expected update level to be accepted as a new valid Process revision. The applicable revision level depends on the contents being modified using submitted request body fields according to the following table. When a combination of the below items occur, the higher update level is required.

HTTP Method

Level

Change

Examples

PATCH

PATCH

Modifications to metadata not impacting the Process execution or definition.

  • Process description, title strings

  • Process keywords, metadata lists

  • inputs/outputs description, title strings

  • inputs/outputs keywords, metadata lists

PATCH

MINOR

Modification that impacts how the Process could be executed, but not its definition.

PUT

MAJOR

Modification that impacts what the Process executes.

  • Any Application Package modification

  • Any inputs/outputs change (formats, occurs, type)

  • Any inputs/outputs addition or removal

Note

For all applicable fields of updating a Process, refer to the schema of PATCH {WEAVER_URL}/processes/{processID} (Update). For replacing a Process, refer instead to the schema of PUT {WEAVER_URL}/processes/{processID} (Replace). The replacement request contents are extremely similar to the Deploy schema since the full Process definition must be provided.

For example, if the test-process:1.2.3 was previously deployed, and is the active latest revision of that Process, submitting the below request body will produce a PATCH revision as test-process:1.2.4.

Sample request for PATCH revision
PATCH /processes/test-process:1.2.3 HTTP/1.1
Host: weaver.example.com
Content-Type: application/json

{
  "description": "new description",
  "inputs": {
    "input": {
      "description": "modified input description"
    },
    "outputs": {
      "output": {
        "title": "modified title"
      }
    }
  }
}

Here, only metadata is adjusted and there is no risk to impact produced results or execution methods of the Process. An external user would probably not even notice the Process changed, which is why PATCH is reasonable in this case. Notice that the version is not explicitly provided in the body. It is guessed automatically from the modified contents. Also, the example displays how Process-level and inputs/outputs-level metadata can be updated.

Similarly, the following request would produce a MINOR revision of test-process. Since both PATCH and MINOR level contents are defined for update, the higher MINOR revision is required. In this case MINOR is required because jobControlOptions (forced to asynchronous execution for following versions) would break any future request made by users that would expect the Process to run (or support) synchronous execution.

Notice that this time, the Process reference does not indicate the revision in the path (no :1.2.4 part). This automatically resolves to the updated revision test-process:1.2.4 that became the new latest revision following our previous PATCH request.

Sample request for MINOR revision
PATCH /processes/test-process HTTP/1.1
Host: weaver.example.com
Content-Type: application/json

{
  "description": "process async only",
  "jobControlOptions": ["async-execute"],
  "version": "1.4.0"
}

In this case, the desired version (1.4.0) is also specified explicitly in the body. Since the updated number (MINOR = 4) matches the expected update level from the above table and respects an higher level than the reference 1.2.4 Process, this revision value will be accepted (instead of auto-resolved 1.3.0 otherwise). Note that if 2.4.0 was specified instead, the version would be refused, as Weaver does not consider this modification to be worth a MAJOR revision, and tries to keep version levels consistent. Skipping numbers (i.e.: 1.3.0 in this case), is permitted as long as there are no other versions above of the same level (i.e.: 1.4.0 would be refused if 1.5.0 existed). This allows some level of flexibility with revisions in case users want to use specific numbering values that have more meaning to them. It is recommended to let Weaver auto-update version values between updates if this level of fined-grained control is not required.

Note

To avoid conflicting definitions, a Process cannot be Deployed directly using a {processID}:{version} reference. Deployments are expected as the first revision and should only include the {processID} portion as their identifier.

If the user desires a specific version to deploy, the PUT request should be used with the appropriate version within the request body. It is although up to the user to provide the full definition of that Process, as PUT request will completely replace the previous definition rather than transfer over previous updates (i.e: PATCH requests).

Even when a Process is “replaced” using PUT, the older revision is not actually removed and undeployed (DELETE request). It is therefore still possible to refer to the old revision using explicit references with the corresponding version. Weaver keeps track of revisions by corresponding {processID} entries such that if the latest revision is undeployed, the previous revision will automatically become the latest once again. For complete replacement, the user should instead perform a DELETE of all existing revisions (to avoid conflicts) followed by a new Deploy request.

Execution of a process (Execute)

Process execution (i.e.: submitting a Job) is accomplished using the POST {WEAVER_URL}/processes/{processID}/execution (Execute) request.

Note

For backward compatibility, the POST {WEAVER_URL}/processes/{processID}/jobs (Execute) request is also supported as alias to the above OGC API - Processes compliant endpoint.

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.

Job Execution Payload as Listing
{
  "mode": "async",
  "response": "document",
  "inputs": [
    {
      "id": "input-file",
      "href": "<some-file-reference"
    },
    {
      "id": "input-value",
      "data": 1,
    }
  ],
  "outputs": [
    {
      "id": "output",
      "transmissionMode": "reference"
    }
  ]
}
Job Execution Payload as Mapping
{
  "mode": "async",
  "response": "document",
  "inputs": {
    "input-file": {
      "href": "<some-file-reference"
    },
    "input-value": {
      "value": 1
    }
  },
  "outputs": {
    "output": {
      "transmissionMode": "reference"
    }
  }
}

Note

For backward compatibility, the execution payload inputs and outputs can be provided either as mapping (keys are the IDs, values are the content), or as listing (each item has content and "id" field) interchangeably. When working with OGC API - Processes compliant services, the mapping representation should be preferred as it is the official schema, is more compact, and it allows inline specification of literal data (values provided without the nested value field). The listing representation is the older format employed during previous OGC testbed developments.

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.

See also

Changed in version 4.20.

With the addition of Process revisions (see Update Operation section), a registered Process specified only by {processID} will execute the latest revision of that Process. An older revision can be executed by adding the tagged version in the path ({processID}:{version}) or adding the request query parameter version.

Execution Body

The inputs definition is the most important section of the request body. It is also the only one that is completely required when submitting the execution request, even for a no-input process (an empty mapping is needed in such case). 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.

The outputs section defines, for each id corresponding to the Process definition, how to report the produced outputs from a successful Job completion. For the time being, Weaver only implement the reference result 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 mode value returns the contents directly in the response instead of the URL.

When outputs section is omitted, it simply means that the Process to be executed should return all outputs it offers in the created Job Results. In such case, because no representation modes is specified for individual outputs, Weaver automatically selects reference as it makes all outputs more easily accessible with distinct URL afterwards. If the outputs section is specified, but that one of the outputs defined in the Process Description is not specified, that output should be omitted from the produced results. For the time being, because only reference representation is offered for produced output files, this filtering is not implemented as it offers no additional advantage for files accessed directly with their distinct URLs. This could be added later if Multipart raw data representation is required. Please submit a new issue to request this feature if it is relevant for your use-cases.

Todo

Filtering of outputs not implemented (everything always available). https://github.com/crim-ca/weaver/issues/380

Other parameters presented in the above examples, namely mode and response are further detailed in the following Execution Mode section.

Execution Mode

In order to select how to execute a Process, either synchronously or asynchronously, the Prefer header should be specified. If omitted, Weaver defaults to asynchronous execution. To execute asynchronously explicitly, Prefer: respond-async should be used. Otherwise, the synchronous execution can be requested with Prefer: wait=X where X is the duration in seconds to wait for a response. If no worker becomes available within that time, or if this value is greater than weaver.exec_sync_max_wait, the Job will resume asynchronously and the response will be returned. Furthermore, synchronous and asynchronous execution of a Process can only be requested for corresponding jobControlOptions it reports as supported in its Process Description. It is important to provide the jobControlOptions parameter with applicable modes when Deploying a Process to allow it to run as desired. By default, Weaver will assume that deployed processes are only asynchronous to handle longer operations.

Changed in version 4.15: By default, every Builtin Process can accept both modes. All previously deployed processes will only allow asynchronous execution, as only this one was supported. This should be reported in their jobControlOptions.

Warning

It is important to remember that the Prefer header is indeed a preference. If Weaver deems it cannot allocate a worker to execute the task synchronously within a reasonable delay, it can enforce the asynchronous execution. The asynchronous mode is also prioritized for running longer Job submitted over the task queue, as this allows Weaver to offer better availability for all requests submitted by its users. The synchronous mode should be reserved only for very quick and relatively low computation intensive operations.

The mode field displayed in the body is another method to tell whether to run the Process in a blocking (sync) or non-blocking (async) manner. Note that support is 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 Monitoring request. As soon as any task worker becomes available, it will pick any leftover queued Job to execute it.

Note

The mode field is an older methodology that precedes the official OGC API - Processes method using the Prefer header. It is recommended to employ the Prefer header that ensures higher interoperability with other services using the same standard. The mode field is deprecated and preserved only for backward compatibility purpose.

When requesting a synchronous execution, and provided a worker was available to pick and complete the task before the maximum wait time was reached, the final status will be directly returned. Therefore, the contents obtained this way will be identical to any following Job Status request. If no worker is available, or if the worker that picked the Job cannot complete it in time (either because it takes too long to execute or had to wait on resources for too long), the Job execution will automatically switch to asynchronous mode.

The distinction between an asynchronous or synchronous response when executing a Job can be observed in multiple ways. The easiest is with the HTTP status code of the response, 200 being for a Job entirely completed synchronously, and 201 for a created Job that should be monitored asynchronously. Another method is to observe the "status" value. Effectively, a Job that is executed asynchronously will return status information contents, while a synchronous Job will return the results directly, along a Location header referring to the equivalent contents returned by GetStatus as in the case of asynchronous Job. It is also possible to extract the Preference-Applied response header which will clearly indicate if the submitted Prefer header was respected (because it could be with available worker resources) or not. In general, this means that if the Job submission request was not provided with Prefer: wait=X AND replied with the same Preference-Applied value, it is safe to assume Weaver decided to queue the Job for asynchronous execution. That Job could be executed immediately, or at a later time, according to worker availability.

It is also possible that a failed Job, even when synchronous, will respond with equivalent contents to the status location instead of results. This is because it is impossible for Weaver to return the result(s) as outputs would not be generated by the incomplete Job.

Finally, the response parameter defines how to return the results produced by the Process. When response=document, regardless of mode=async or mode=sync, and regardless of requested outputs transmissionMode=value or transmissionMode=reference, the results will be returned in a JSON format containing either literal values or URL references to produced files. If mode=async, this results document is obtained with GET {WEAVER_URL}/jobs/{jobID}/results (Results) request, while mode=sync returns it directly. When response=raw, the specific contents (type and quantity), HTTP Link headers or a mix of those components depends both on the number of available Process outputs, which ones were requested, and how they were requested (i.e.: transmissionMode). It is also possible that further content negotiation gets involved accordingly to the Accept header and available Content-Type of the outputs if multiple formats are supported by the Process. For more details regarding those combination, the official OGC API - Processes, Responses (sync) and OGC API - Processes, Responses (async) should be employed as reference.

For any of the previous combinations, it is always possible to obtain Job outputs, along with logs, exceptions and other details using the Obtaining results, outputs, logs or errors endpoints.

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 asynchronous execution, the Job status can be requested using GET {WEAVER_URL}/processes/{processID}/jobs/{jobID} (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 Result section.

Process Operations

Todo

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

Workflow Step Operations

For each Type of Processes known by Weaver, specific Workflow step implementations must be provided.

In order to simplify the chaining procedure of file references, step implementations are only required to provide the relevant methodology for their Deploy, Execute, Monitor and ref:Result <proc_op_result> operations. Operations related to staging of files, Process preparation and cleanup are abstracted away from specific implementations to ensure consistent functionalities between each type.

Operations are accomplished in the following order for each individual step:

Step Method

Requirements

Description

prepare

I*

Setup any prerequisites for the Process or Job.

stage_inputs

R

Retrieve input locations (considering remote files and Workflow previous-step staging).

format_inputs

I*

Perform operations on staged inputs to obtain desired format expected by the target Process.

format_outputs

I*

Perform operations on expected outputs to obtain desired format expected by the target Process.

dispatch

R,I

Perform request for remote execution of the Process.

monitor

R,I

Perform monitoring of the Job status until completion.

get_results

R,I

Perform operations to obtain results location in the expected format from the target Process.

stage_results

R

Retrieve results from remote Job for local storage using output locations.

cleanup

I*

Perform any final steps before completing the execution or after failed execution.

Note

See also

weaver.processes.wps_process_base.WpsProcessInterface.execute() for the implementation of operations order.

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 or Directory reference. Files in Weaver (and WPS in general) can be specified with any formats as Media-Types.

As for standard WPS, only remote File references are usually handled and limited to http(s) scheme, unless the process takes a LiteralData input string and parses the unusual reference from its value to process it by itself. On the other hand, Weaver supports all following reference schemes.

  • http(s)://

  • file://

  • s3://

  • opensearchfile:// [experimental]

Note

Handling of Directory type for above references is specific to Weaver. Directories require specific formats and naming conditions as described in Directory Type. Remote WPS could support it but their expected behaviour is undefined.

The method in which Weaver will handle such references depends on its configuration, in other words, whether it is running as ADES, EMS or HYBRID (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 (see also Remote Applications), 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 situation for 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 http(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.

Note

An exception to above mentioned skipped fetching of http(s):// files is when the corresponding Process types are intermediate steps within a Workflow. In this case, local staging of remote results occurs between each step because Weaver cannot assume any of the remote Provider is able to communicate with each other, according to potential Request Options or Data Source only configured for access by Weaver.

When using AWS S3 references, Weaver will attempt to retrieve the files 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 files and stage them 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 files. Please refer to Configuration of AWS S3 Buckets for more details.

Important

Different formats for AWS S3 references are handled by Weaver (see AWS S3 Bucket References). They can be formed with generic s3:// and specific http(s):// with some reference to Amazon AWS endpoint. When a reference with http(s)://-like scheme refers to an S3 bucket, it will be converted accordingly and handled as any other s3:// reference. In the below Summary of File Type Handling Methods, these special HTTP-like URLs should be understood as part of the s3:// category.

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.

Summary of File Type Handling Methods

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 (unmodified)

s3://

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

vault://<UUID>

Convert to http(s):// [6]

file://

Nothing (file already local)

http(s)://

Fetch and convert to file://

s3://

vault://<UUID>

Convert to file://

EMS

file://

Convert to http(s):// [2]

http(s)://

Nothing (unmodified, step will handle it)

s3://

vault://<UUID>

HYBRID

Note: HYBRID assumes ADES role (remote processes)

file://

Convert to http(s):// [2]

http(s)://

Nothing (unmodified)

s3://

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

vault://<UUID>

Convert to http(s):// [6]

Note: HYBRID assumes ADES role (local processes)

file://

Nothing (unmodified)

http(s)://

Fetch and convert to file://

vault://<UUID>

Convert to file:// [5]

Note: HYBRID assumes EMS role

file://

Convert to http(s):// [2]

http(s)://

Nothing (unmodified, step will handle it)

s3://

vault://<UUID>

Footnotes

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

File Reference Names

When processing any of the previous File Reference Types, the resulting name of the file after retrieval can depend on the applicable scheme. In most cases, the file name is simply the last fragment of the path, whether it is an URL, an S3 bucket or plainly a file directory path. The following cases are exceptions.

Changed in version 4.4: When using http(s):// references, the Content-Disposition header can be provided with filename and/or filename* as specified by RFC 2183, RFC 5987 and RFC 6266 specifications in order to define a staging file name. Note that Weaver takes this name only as a suggestion as will ignore the preferred name if it does not conform to basic naming conventions for security reasons. As a general rule of thumb, common alphanumeric characters and separators such as dash (-), underscores (_) or dots (.) should be employed to limit chances of errors. If none of the suggested names are valid, Weaver falls back to the typical last fragment of the URL as file name.

New in version 4.27: References using any scheme can refer to a Directory. Do do so, they must respect definitions in Directory Type. When provided, all retrievable contents under that directory will be recursively staged.

When using s3:// references (or equivalent http(s):// referring to S3 bucket), the staged file names will depend on the stored object names within the bucket. In that regard, naming conventions from AWS should be respected.

When using vault://<UUID> references, the resulting file name will be obtained from the filename specified in the Content-Disposition within the uploaded content of the multipart/form-data request.

File Vault Inputs

See also

Refer to Uploading File to the Vault section for general details about the Vault feature.

Stored files in the Vault can be employed as input for Execution of a process (Execute) operation using the provided vault://<UUID> reference from the response following upload. The Execute request must also include the X-Auth-Vault header to obtain access to the file.

Warning

Avoid using the Vault HTTP location as href input. Prefer the vault://<UUID> representation.

The direct Vault HTTP location SHOULD NOT be employed as input reference to a Process to ensure its proper interpretation during execution. There are two main reasons for this.

Firstly, using the plain HTTP endpoint will not provide any hint to Weaver about whether the input link is a generic remote file or one hosted in the Vault. With the lack of this information, Weaver could attempt to download the file to retrieve it for its local Process execution, creating unnecessary operations and wasting bandwidth since it is already available locally. Furthermore, the Vault behaviour that deletes the file after its download would cause it to become unavailable upon subsequent access attempts, as it could be the case during handling and forwarding of references during intermediate Workflow step operations. This could inadvertently break the Workflow execution.

Secondly, without the explicit Vault reference, Weaver cannot be aware of the necessary X-Auth-Vault authorization needed to download it. Using the vault://<UUID> not only tells Weaver that it must forward any relevant access token to obtain the file, but it also ensures that those tokens are not inadvertently sent to other locations. Effectively, because the Vault can be used to temporarily host sensitive data for Process execution, Weaver can better control and avoid leaking the access token to irrelevant resource locations such that only the intended Job and specific input can access it. This is even more important in situations where multiple Vault references are required, to make sure each input forwards the respective access token for retrieving its file.

When submitting the Execute request, it is important to provide the X-Auth-Vault header with additional reference to the Vault parameter when multiple files are involved. Each token should be provided using a comma to separated them, as detailed below. When only one file refers to the Vault the parameters can be omitted since there is no need to map between tokens and distinct vault://<UUID> entries.

Sample request contents to execute process with vault files
POST /processes/{process_id}/execution HTTP/1.1
Host: weaver.example.com
Content-Type: application/json
X-Auth-Vault: token <access-token-1>; id=<vault-uuid-1>,token <access-token-2>; id=<vault-uuid-2>

{
  "mode": "async",
  "response": "document",
  "inputs": {"input-1": {"href": "vault://<vault-uuid-1>"}, "input-2": {"href": "vault://<vault-uuid-2>"}},
  "outputs": {"out": {"transmissionMode": "reference"}}
}

The notation (RFC 5234, RFC 7230#section-1.2) of the X-Auth-Vault header is presented below.

X-Auth-Vault = vault-unique / vault-multi

vault-unique = credentials [ BWS ";" OWS auth-param ]
vault-multi  = credentials BWS ";" OWS auth-param 1*( "," OWS credentials BWS ";" OWS auth-param )
credentials  = auth-scheme RWS access-token
auth-scheme  = "token"
auth-param   = "id" "=" vault-id
vault-id     = UUID / ( DQUOTE UUID DQUOTE )
access-token = base64
base64       = <base64, see RFC 4648#section-4>
DQUOTE       = <DQUOTE, see RFC 7230#section-1.2>
UUID         = <UUID, see RFC 4122#section-3>
BWS          = <BWS, see RFC 7230#section-3.2.3>
OWS          = <OWS, see RFC 7230#section-3.2.3>
RWS          = <RWS, see RFC 7230#section-3.2.3>

In summary, the access token can be provided by itself by omitting the Vault UUID parameter only if a single file is referenced across all inputs within the Execute request. Otherwise, multiple Vault references all require to specify both their respective access token and UUID in a comma separated list.

AWS S3 Bucket References

File and directory references to AWS S3 items can be defined using one of the below formats. They can either use the http(s):// or s3://, whichever one is deemed more appropriate by the user. The relevant reference format according to the location where the Bucket is hosted and can be accessed from must be employed.

HTTP Path-style URI
https://s3.{Region}.amazonaws.com/{Bucket}/[{dirs}/][{file-key}]
HTTP Virtual-hosted–style URI
https://{Bucket}.s3.{Region}.amazonaws.com/[{dirs}/][{file-key}]
HTTP Access-Point-style URI
https://{AccessPointName}-{AccountId}.s3-accesspoint.{Region}.amazonaws.com/[{dirs}/][{file-key}]
HTTP Outposts-style URI
https://{AccessPointName}-{AccountId}.{outpostID}.s3-outposts.{Region}.amazonaws.com/[{dirs}/][{file-key}]
S3 Default Region URI
s3://{Bucket}/[{dirs}/][{file-key}]
S3 Access-Point-style ARN
arn:aws:s3:{Region}:{AccountId}:accesspoint/{AccessPointName}/[{dirs}/][{file-key}]
S3 Outposts-style ARN
arn:aws:s3-outposts:{Region}:{AccountId}:outpost/{OutpostId}/accesspoint/{AccessPointName}/[{dirs}/][{file-key}]

Warning

Using the s3:// with a Bucket name directly (without ARN) implies that the default profile from the configuration will be used (see Configuration of AWS S3 Buckets).

See also

Following external resources can be employed for more details on the AWS S3 service, nomenclature and requirements.

OpenSearch Data Source

In order to provide OpenSearch query results as input to Process for execution, the corresponding Deploy request body must be provided with additionalParameters in order to indicate how to interpret any specified metadata. The appropriate OpenSearch queries can then be applied prior the execution to retrieve the explicit file reference(s) of EOImage elements that have been found and to be submitted to the Job.

Depending on the desired context (application or per-input) over which the AOI, TOI, EOImage and multiple other metadata search filters are to be applied, their definition can be provided in the following locations within the Deploy body.

Context

Location

Role

Application

processDescription.process.additionalParameters

http://www.opengis.net/eoc/applicationContext

Input

processDescription.process.inputs[*].additionalParameters

http://www.opengis.net/eoc/applicationContext/inputMetadata

The distinction between application or per-input contexts is entirely dependent of whatever is the intended processing operation of the underlying Process, which is why they must be defined by the user deploying the process since there is no way for Weaver to automatically infer how to employ provided search parameters.

In each case, the structure of additionalParameters should be similar to the following definition:

{
  "additionalParameters": [
    {
      "role": "http://www.opengis.net/eoc/applicationContext/inputMetadata",
      "parameters": [
        {
          "name": "EOImage",
          "values": [
            "true"
          ]
        },
        {
          "name": "AllowedCollections",
          "values": "s2-collection-1,s2-collection-2,s2-sentinel2,s2-landsat8"
        }
      ]
    }
  ]
}

In each case, it is also expected that the role should correspond to the location where the definition is provided accordingly to their context from the above table.

For each deployment, processes using EOImage to be processed into OpenSearch query results can interpret the following field definitions for mapping against respective inputs or application context.

Name

Values

Context

Description

EOImage

["true"]

Input

Indicates that the nested parameters within the current additionalParameters section where it is located defines an EOImage. This is to avoid misinterpretation by similar names that could be employed by other kind of definitions. The Process input’s id where this parameter is defined is the name that will be employed to pass down OpenSearch results.

AllowedCollections

String of comma-separated list of collection IDs.

Input (same one as EOImage)

Provides a subset of collection identifiers that are supported. During execution any specified input not respecting one of the defined values will fail OpenSearch query resolution.

CatalogSearchField

["<name>"]

Input (other one than EOImage)

String with the relevant OpenSearch query filter name according to the described input. Defines a given Process input id to be mapped against the specified query name.

UniqueAOI

["true"]

Application

Indicates that provided CatalogSearchField (typically bbox) corresponds to a global AOI that should be respected across multiple EOImage inputs. Otherwise, (default values: ["false"]) each EOImage should be accompanied with its respective AOI definition.

UniqueTOI

["true"]

Application

Indicates that provided CatalogSearchField (typically StartDate and EndDate) corresponds to a global TOI that should be respected across multiple EOImage inputs. Otherwise, (default values: ["false"]) each EOImage should be accompanied with its respective TOI definition.

When an EOImage is detected for a given Process, any submitted Job execution will expect the defined inputs in the Process description to indicate which images to retrieve for the application. Using inputs defined with corresponding CatalogSearchField filters, a specific OpenSearch query will be sent to obtain the relevant images. The inputs corresponding to search fields will then be discarded following OpenSearch resolution. The resolved link(s) for to EOImage will be substituted within the id of the input where EOImage was specified and will be forwarded to the underlying Application Package for execution.

Note

Collection identifiers are mapped against URL endpoints defined in configuration to execute the appropriate OpenSearch requests. See Configuration of Data Sources for more details.

See also

Definitions in OpenSearch Deploy request body provides a more detailed example of the expected structure and relevant additionalParameters locations.

See also

Definitions in OpenSearch Examples providing different combinations of inputs, notably for using distinct AOI, term:TOI and collections, with or without UniqueAOI and UniqueTOI specifiers.

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

Outputs Location

By default, Job results will be hosted under the endpoint configured by weaver.wps_output_url and weaver.wps_output_path, and will be stored under directory defined by weaver.wps_output_dir setting.

Warning

Hosting of results from the file system is NOT handled by Weaver itself. The API will only report the expected endpoints using configured weaver.wps_output_url. It is up to an alternate service or the platform provider that serves the Weaver application to provide the external hosting and availability of files online as desired.

Each Job will have its specific UUID employed for all of the outputs files, logs and status in order to avoid conflicts. Therefore, outputs will be available with the following location:

{WPS_OUTPUT_URL}/{JOB_UUID}.xml             # status location
{WPS_OUTPUT_URL}/{JOB_UUID}.log             # execution logs
{WPS_OUTPUT_URL}/{JOB_UUID}/{output.ext}    # results of the job if successful

Note

Value WPS_OUTPUT_URL in above example is resolved accordingly with weaver.wps_output_url, weaver.wps_output_path and weaver.url, as per Configuration Settings details.

When submitting a Job for execution, it is possible to provide the X-WPS-Output-Context header. This modifies the output location to be nested under the specified directory or sub-directories.

For example, providing X-WPS-Output-Context: project/test-1 will result in outputs located at:

{WPS_OUTPUT_URL}/project/test-1/{JOB_UUID}/{output.ext}

Note

Values provided by X-WPS-Output-Context can only contain alphanumeric, hyphens, underscores and path separators that will result in a valid directory and URL locations. The path is assumed relative by design to be resolved under the WPS output directory, and will therefore reject any . or .. path references. The path also CANNOT start by /. In such cases, an HTTP error will be immediately raised indicating the symbols that where rejected when detected within X-WPS-Output-Context header.

If desired, parameter weaver.wps_output_context can also be defined in the Configuration Settings in order to employ a default directory location nested under weaver.wps_output_dir when X-WPS-Output-Context header is omitted from the request. By default, this parameter is not defined (empty) in order to store Job results directly under the configured WPS output directory.

Note

Header X-WPS-Output-Context is ignored when using S3 buckets for output location since they are stored individually per Job UUID, and hold no relevant context location. See also Configuration of AWS S3 Buckets.

New in version 4.3: Addition of the X-WPS-Output-Context header.

Notification Subscribers

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).

Alternatively to notification_email, the subscribers field of the API can be employed during Job submission. Using this field will take precedence over notification_email for corresponding email and status combinations. The Job subscribers allow more fined-grained control over which emails will be sent for the various combinations of Job status milestones.

Furthermore, subscribers allow specifying URLs where HTTP(S) requests will be sent with the Job Status or Job Results contents directly in JSON format. This allows users and/or servers to directly receive the necessary details using a push-notification mechanism instead of the polling-based method on the Job Status endpoint otherwise required to obtain updated Job details.

See also

Refer to the |oas-rtd|_ of the POST {WEAVER_URL}/processes/{processID}/execution (Execute) request for all available subscribers properties.

Monitoring of a process execution (GetStatus)

Monitoring the execution of a Job consists of polling the status Location provided from the execute operation and verifying the indicated status for the expected result. The status can correspond to any of the value defined by weaver.status.JOB_STATUS_VALUES accordingly to the internal state of the workers processing their execution.

When targeting a Job submitted to a Weaver instance, monitoring is usually accomplished through the OGC API - Processes endpoint using GET {WEAVER_URL}/processes/{processID}/jobs/{jobID} (GetStatus), which will return a JSON body. Alternatively, the XML status location document returned by the WPS Endpoint could also be employed to monitor the execution.

In general, both endpoints should be interchangeable, using below mapping. The Job monitoring process keeps both contents equivalent according to their standard. For convenience, requesting the execute with Accept: <content-type> header corresponding to either JSON or XML should redirect to the response of the relevant endpoint, regardless of where the original request was submitted. Otherwise, the default contents format is employed according to the chosen location.

Standard

Contents

Location

OGC API - Processes

JSON

{WEAVER_URL}/jobs/{JobUUID}

WPS

XML

{WEAVER_WPS_OUTPUTS}/{JobUUID}.xml

See also

For the WPS endpoint, refer to Configuration Settings.

Obtaining results, outputs, logs or errors

In the case of successful Job execution, the outputs can be retrieved with GET {WEAVER_URL}/jobs/{jobID}/outputs (Outputs) request to list each corresponding output id with the generated file reference URL. Keep in mind that the purpose of those URLs 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 Configuration parameters for the base WPS output location:

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

For the OGC compliant endpoint, the GET {WEAVER_URL}/jobs/{jobID}/results (Results) request can be employed instead. In the event of a Job executed with response=document, the contents will be very similar. On the other hand, a Job submitted with response=raw can produce many alternative variations according to OGC requirements. For this reason, the outputs endpoint will always provide all data and file references in the response body as Job, no matter the original response format. The outputs endpoint can also receive additional query parameters, such as schema, to return contents formatted similarly to results, but enforcing a JSON body as if response=document was specified during submission of the Process execution.

In order to better understand the parameters that where submitted during Job creation, the GET {WEAVER_URL}/jobs/{jobID}/inputs (Inputs) can be employed. This will return both the data and reference inputs that were submitted, as well as the requested outputs to retrieve any relevant transmissionMode definition.

In situations where the Job resulted into failed status, the GET {WEAVER_URL}/processes/{processID}/jobs/{jobID}/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/{processID}/jobs/{jobID}/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.

[
  "[2021-03-02 03:32:39] INFO     [weaver.datatype.Job] 0:00:00   1% accepted   Job task setup completed.",
  "[2021-03-02 03:32:39] INFO     [weaver.datatype.Job] 0:00:00   2% accepted   Execute WPS request for process [ncdump]",
  "[2021-03-02 03:32:39] INFO     [weaver.datatype.Job] 0:00:01   3% accepted   Fetching job input definitions.",
  "[2021-03-02 03:32:39] INFO     [weaver.datatype.Job] 0:00:01   4% accepted   Fetching job output definitions.",
  "[2021-03-02 03:32:41] INFO     [weaver.datatype.Job] 0:00:02   5% accepted   Starting job process execution.",
  "[2021-03-02 03:32:41] INFO     [weaver.datatype.Job] 0:00:02   5% accepted   Following updates could take a while until the Application Package answers...",
  "[2021-03-02 03:32:43] DEBUG    [weaver.datatype.Job] 0:00:05   6% accepted   Updated job status location: [/tmp/14c68477-c3ed-4784-9c0f-a4c9e1344db5.xml].",
  "[2021-03-02 03:32:43] INFO     [weaver.datatype.Job] 0:00:05   7% running    Starting monitoring of job execution.",
  "[2021-03-02 03:32:43] INFO     [weaver.datatype.Job] 0:00:05   8% running    [2021-03-02 03:32:41] INFO     [weaver.processes.wps_package.ncdump]    1% running    Preparing package logs done.",
  "[2021-03-02 03:32:43] INFO     [weaver.datatype.Job] 0:00:05   9% running    [2021-03-02 03:32:41] INFO     [weaver.processes.wps_package.ncdump]    2% running    Launching package...",
  "[2021-03-02 03:32:43] INFO     [weaver.datatype.Job] 0:00:05  11% running    [2021-03-02 03:32:41] INFO     [weaver.processes.wps_package.ncdump] Visible application CWL euid:egid [1000:1000]",
  "[2021-03-02 03:32:43] INFO     [weaver.datatype.Job] 0:00:05  13% running    [2021-03-02 03:32:41] DEBUG    [weaver.processes.wps_package.ncdump] Using cwltool.RuntimeContext args:",
  "[2021-03-02 03:32:43] INFO     [weaver.datatype.Job] 0:00:05  15% running    {",
  "[2021-03-02 03:32:43] INFO     [weaver.datatype.Job] 0:00:05  17% running      \"no_read_only\": false,",
  "[2021-03-02 03:32:43] INFO     [weaver.datatype.Job] 0:00:05  19% running      \"no_match_user\": false,",
  "[2021-03-02 03:32:43] INFO     [weaver.datatype.Job] 0:00:05  21% running      \"tmpdir_prefix\": \"/tmp/weaver-hybrid/cwltool_tmp_\",",
  "[2021-03-02 03:32:43] INFO     [weaver.datatype.Job] 0:00:05  23% running      \"tmp_outdir_prefix\": \"/tmp/weaver-hybrid/cwltool_out_\",",
  "[2021-03-02 03:32:43] INFO     [weaver.datatype.Job] 0:00:05  25% running      \"outdir\": \"/tmp/weaver-hybrid/pywps_process_ughz7_oc\",",
  "[2021-03-02 03:32:43] INFO     [weaver.datatype.Job] 0:00:05  27% running      \"debug\": true",
  "[2021-03-02 03:32:43] INFO     [weaver.datatype.Job] 0:00:05  29% running    }",
  "[2021-03-02 03:32:43] INFO     [weaver.datatype.Job] 0:00:05  31% running    [2021-03-02 03:32:41] INFO     [cwltool] Resolved '/tmp/tmpdkg7lj26/ncdump' to 'file:///tmp/tmpdkg7lj26/ncdump'",
  "[2021-03-02 03:32:43] INFO     [weaver.datatype.Job] 0:00:05  33% running    [2021-03-02 03:32:41] INFO     [cwltool] ../../../../tmp/tmpdkg7lj26/ncdump:1:1: Unknown hint file:///tmp/tmpdkg7lj26/WPS1Requirement",
  "[2021-03-02 03:32:43] INFO     [weaver.datatype.Job] 0:00:05  35% running    [2021-03-02 03:32:41] INFO     [weaver.processes.wps_package.ncdump]    5% running    Loading package content done.",
  "[2021-03-02 03:32:43] INFO     [weaver.datatype.Job] 0:00:05  37% running    [2021-03-02 03:32:41] INFO     [weaver.processes.wps_package.ncdump]    6% running    Retrieve package inputs done.",
  "[2021-03-02 03:32:43] INFO     [weaver.datatype.Job] 0:00:05  39% running    [2021-03-02 03:32:41] INFO     [weaver.processes.wps_package.ncdump] File input (dataset) SKIPPED fetch: [https://schema-example.com/data/test.nc]",
  "[2021-03-02 03:32:43] INFO     [weaver.datatype.Job] 0:00:05  41% running    [2021-03-02 03:32:42] INFO     [weaver.processes.wps_package.ncdump]    8% running    Convert package inputs done.",
  "[2021-03-02 03:32:43] INFO     [weaver.datatype.Job] 0:00:05  43% running    [2021-03-02 03:32:42] INFO     [weaver.processes.wps_package.ncdump]   10% running    Running package...",
  "[2021-03-02 03:32:43] INFO     [weaver.datatype.Job] 0:00:05  45% running    [2021-03-02 03:32:42] DEBUG    [weaver.processes.wps_package.ncdump] Launching process package with inputs:",
  "[2021-03-02 03:32:43] INFO     [weaver.datatype.Job] 0:00:05  47% running    {",
  "[2021-03-02 03:32:43] INFO     [weaver.datatype.Job] 0:00:05  49% running      \"dataset\": {",
  "[2021-03-02 03:32:43] INFO     [weaver.datatype.Job] 0:00:05  51% running        \"location\": \"https://schema-example.com/data/test.nc\",",
  "[2021-03-02 03:32:43] INFO     [weaver.datatype.Job] 0:00:05  52% running        \"class\": \"File\",",
  "[2021-03-02 03:32:43] INFO     [weaver.datatype.Job] 0:00:05  54% running        \"format\": \"http://edamontology.org/format_3650\"",
  "[2021-03-02 03:32:43] INFO     [weaver.datatype.Job] 0:00:05  56% running      }",
  "[2021-03-02 03:32:43] INFO     [weaver.datatype.Job] 0:00:05  58% running    }",
  "[2021-03-02 03:32:43] INFO     [weaver.datatype.Job] 0:00:05  60% running    [2021-03-02 03:32:42] INFO     [weaver.processes.wps_package.ncdump]   10% running    Preparing to launch package ncdump.",
  "[2021-03-02 03:32:43] INFO     [weaver.datatype.Job] 0:00:05  62% running    [2021-03-02 03:32:42] INFO     [weaver.processes.wps_package.ncdump] WPS-1 Package resolved from requirement/hint: WPS1Requirement",
  "[2021-03-02 03:32:43] INFO     [weaver.datatype.Job] 0:00:05  64% running    [2021-03-02 03:32:42] INFO     [weaver.processes.wps_package.ncdump]   11% running    https://schema-example.com/remote-wps [ncdump] - Preparing execute request for remote WPS1 provider.",
  "[2021-03-02 03:32:43] INFO     [weaver.datatype.Job] 0:00:05  66% running    [2021-03-02 03:32:43] INFO     [weaver.processes.wps_package.ncdump]   14% running    https://schema-example.com/remote-wps [ncdump] - Executing job on remote WPS1 provider.",
  "[2021-03-02 03:32:43] INFO     [weaver.datatype.Job] 0:00:05  68% running    [2021-03-02 03:32:43] INFO     [weaver.processes.wps_package.ncdump]   18% running    https://schema-example.com/remote-wps [ncdump] - Monitoring job on remote WPS1 provider : [https://schema-example.com/remote-wps]",
  "[2021-03-02 03:32:43] INFO     [weaver.datatype.Job] 0:00:05  70% running    [2021-03-02 03:32:43] INFO     [weaver.processes.wps_package.ncdump]   86% running    https://schema-example.com/remote-wps [ncdump] - 100% succeeded  PyWPS Process NCDump finished",
  "[2021-03-02 03:32:43] INFO     [weaver.datatype.Job] 0:00:05  72% running    [2021-03-02 03:32:43] INFO     [weaver.processes.wps_package.ncdump]   86% running    https://schema-example.com/remote-wps [ncdump] - Fetching job outputs from remote WPS1 provider.",
  "[2021-03-02 03:32:43] INFO     [weaver.datatype.Job] 0:00:05  74% running    [2021-03-02 03:32:43] INFO     [weaver.processes.wps_package.ncdump]   95% succeeded  https://schema-example.com/remote-wps [ncdump] - Execution on remote WPS1 provider completed.",
  "[2021-03-02 03:32:43] INFO     [weaver.datatype.Job] 0:00:05  76% running    [2021-03-02 03:32:43] DEBUG    [cwltool] Moving /tmp/weaver-hybrid/cwltool_out_fitllvxx/output.txt to /tmp/weaver-hybrid/pywps_process_ughz7_oc/output.txt",
  "[2021-03-02 03:32:43] INFO     [weaver.datatype.Job] 0:00:05  78% running    [2021-03-02 03:32:43] DEBUG    [cwltool] Moving /tmp/weaver-hybrid/cwltool_out_fitllvxx/stderr.log to /tmp/weaver-hybrid/pywps_process_ughz7_oc/stderr.log",
  "[2021-03-02 03:32:43] INFO     [weaver.datatype.Job] 0:00:05  80% running    [2021-03-02 03:32:43] DEBUG    [cwltool] Moving /tmp/weaver-hybrid/cwltool_out_fitllvxx/stdout.log to /tmp/weaver-hybrid/pywps_process_ughz7_oc/stdout.log",
  "[2021-03-02 03:32:43] INFO     [weaver.datatype.Job] 0:00:05  82% running    [2021-03-02 03:32:43] DEBUG    [cwltool] Removing intermediate output directory /tmp/weaver-hybrid/cwltool_out_7mmdwd6w",
  "[2021-03-02 03:32:43] INFO     [weaver.datatype.Job] 0:00:05  84% running    [2021-03-02 03:32:43] DEBUG    [cwltool] Removing intermediate output directory /tmp/weaver-hybrid/cwltool_out_fitllvxx",
  "[2021-03-02 03:32:43] INFO     [weaver.datatype.Job] 0:00:05  86% running    [2021-03-02 03:32:43] INFO     [weaver.processes.wps_package.ncdump]   95% running    Package execution done.",
  "[2021-03-02 03:32:43] INFO     [weaver.datatype.Job] 0:00:05  88% running    [2021-03-02 03:32:43] INFO     [weaver.processes.wps_package.ncdump]   95% running    Nothing captured from internal application logs.",
  "[2021-03-02 03:32:43] INFO     [weaver.datatype.Job] 0:00:05  90% running    [2021-03-02 03:32:43] INFO     [weaver.processes.wps_package.ncdump] Resolved WPS output [output] as file reference: [/tmp/weaver-hybrid/pywps_process_ughz7_oc/output.txt]",
  "[2021-03-02 03:32:43] INFO     [weaver.datatype.Job] 0:00:05  92% running    [2021-03-02 03:32:43] INFO     [weaver.processes.wps_package.ncdump]   98% running    Generate package outputs done.",
  "[2021-03-02 03:32:43] INFO     [weaver.datatype.Job] 0:00:05  94% running    [2021-03-02 03:32:43] INFO     [weaver.processes.wps_package.ncdump]  100% succeeded  Package complete.",
  "[2021-03-02 03:32:43] INFO     [weaver.datatype.Job] 0:00:05  96% succeeded  Job succeeded (status: Package complete.).",
  "[2021-03-02 03:32:43] INFO     [weaver.datatype.Job] 0:00:05  98% succeeded  Job succeeded.",
  "[2021-03-02 03:32:43] INFO     [weaver.datatype.Job] 0:00:05 100% succeeded  Job task complete."
]

Note

All endpoints to retrieve any of the above information about a Job can either be requested directly (i.e.: /jobs/{jobID}/...) or with equivalent Provider and/or Process prefixed endpoints, if the requested Job did refer to those Provider and/or Process. A local Process would have its Job references as /processes/{processId}/jobs/{jobID}/... while a Remote Provider will use /provider/{providerName}/processes/{processId}/jobs/{jobID}/....

Uploading File to the Vault

The Vault is available as secured storage for uploading files to be employed later for Process execution (see also File Vault Inputs).

Note

The Vault is a specific feature of Weaver. Other ADES, EMS and OGC API - Processes servers are not expected to provide this endpoint nor support the vault://<UUID> reference format.

See also

Refer to Configuration of File Vault for applicable settings for this feature.

When upload succeeds, the response will return a Vault UUID and an access_token to access the file. Uploaded files cannot be accessed unless the proper credentials are provided. Requests toward the Vault should therefore include a X-Auth-Vault: token {access_token] header in combination to the provided Vault UUID in the request path to retrieve the file contents. The upload response will also include a file_href field formatted with a vault://<UUID> reference to be used for File Vault Inputs, as well as a Content-Location header of the contextual Vault endpoint for that file.

Download of the file is accomplished using the Vault File Download (GET) request. In order to either obtain the file metadata without downloading it, or simply to validate its existence, the Vault File Details (HEAD) request can be used. This HEAD request can be queried any number of times without affecting the file from the Vault. For both HTTP methods, the X-Auth-Vault header is required.

Note

The Vault acts only as temporary file storage. For this reason, once the file has been downloaded, it is immediately deleted. Download can only occur once. It is assumed that the resource that must employ it will have created a local copy from the download and the Vault doesn’t require to preserve it anymore. This behaviour intends to limit the duration for which potentially sensitive data remains available in the Vault as well as performing cleanup to limit storage space.

Using the Weaver CLI or Python client, it is possible to upload local files automatically to the Vault of a remote Weaver server. This can help users host their local file for remote Process execution. By default, the Weaver CLI and Client will automatically convert any local file path provided as execution input into a vault://<UUID> reference to make use of the Vault self-hosting from the target Weaver instance. It will also update the provided inputs or execution body to apply any transformed vault://<UUID> references transparently. This will allow the executed Process to securely retrieve the files using File Vault Inputs behaviour. Transmission of any required authorization headers is also handled automatically when using this approach.

It is also possible to manually provide vault://<UUID> references or endpoints if those were uploaded beforehand using the upload operation, but the user must also generate the X-Auth-Vault header manually in such case.

See also

Section File Vault Inputs provides more details about the format of X-Auth-Vault for submission of multiple inputs.

In order to manually upload files, the below code snippet can be employed.

Sample Python request call to upload file to Vault
import json

import requests

PATH = "/path/to/local/file.json"
with open(PATH, "w", encoding="utf-8") as file:
    json.dump({"input": "data"}, file)

# provide the desired name and format Media-Type
files = {
    "file": (
        "desired-name.json",
        open(PATH, "r", encoding="utf-8"),
        "application/json; charset=UTF-8"
    )
}
requests.post("https://weaver.example.com/vault", files=files, timeout=5)

This should automatically generate a similar request to the result below.

Sample request contents to upload file to Vault
POST /vault HTTP/1.1
Host: weaver.example.com
Content-Type: multipart/form-data; boundary=43003e2f205a180ace9cd34d98f911ff
Content-Length: 202

--43003e2f205a180ace9cd34d98f911ff
Content-Disposition: form-data; name="file"; filename="desired-name.json"
Content-Type: application/json; charset=UTF-8
{"input": "data"}
--43003e2f205a180ace9cd34d98f911ff--

Warning

When providing literal HTTP request contents as above, make sure to employ CRLF instead of plain LF for separating the data using the boundary. Also, make sure to omit any additional LF between the data and each boundary if this could impact parsing of the data itself (e.g.: as in the case of non-text readable base64 data) to avoid modifying the file contents during upload. Some additional newlines are presented in the above example only for readability purpose. It is recommended to use utilities like the Python example or the Weaver CLI so avoid such issues during request content generation. Please refer to RFC 7578#section-4.1 for more details regarding multipart content separators.

Note that the Content-Type embedded within the multipart content in the above example (not to be confused with the actual Content-Type header of the request for uploading the file) can be important if the destination input of the Process that will consume that Vault file for execution must provide a specific choice of Media-Type if multiple are supported. This value could be employed to generate the explicit format portion of the input, in case it cannot be resolved automatically from the file contents, or unless it is explicitly provided once again for that input within the Execute request body.

WPS Endpoint

This endpoint is available if weaver.wps setting was enabled (true by default). The specific location where WPS requests it will be accessible depends on the resolution of relevant Configuration Settings, namely weaver.wps_path and weaver.wps_url.

Details regarding contents for each request is provided in schemas under WPS Endpoint Requests.

Note

Using the WPS endpoint allows fewer control over functionalities than the corresponding OGC API - Processes (WPS-REST) endpoints since it is the preceding standard.

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

When using either the EMS or HYBRID [8] configurations, Process executions are dispatched to the relevant ADES or another HYBRID server supporting Process deployment operation when inputs are matched against one of the configured Data Source. Minimal implementations of OGC API - Processes can also work as external Provider where to dispatch executions, but in the case of core implementations, the Process should be already available since it cannot be deployed.

In more details, when an Execute request is received, Weaver will analyse any file references in the specified inputs and try to match them against specified Data Source configuration. When a match is found and that the corresponding File Reference Types indicates that the reference is located remotely in a known Data Source provider that should take care of its processing, Weaver will attempt to Deploy the targeted Process (and the underlying Application Package) followed by its remote execution. It will then monitor the Job until completion and retrieve results if the full operation was successful.

The Data Source configuration therefore indicates to Weaver how to map a given data reference to a specific instance or server where that data is expected to reside. This procedure effectively allows Weaver to deliver applications close to the data which can be extremely more efficient (both in terms of time and quantity) than pulling the data locally when Data Source become substantial. Furthermore, it allows Data Source providers to define custom or private data retrieval mechanisms, where data cannot be exposed or offered externally, but are still available for use when requested.

Footnotes

See also

Specific details about configuration of Data Source are provided in the Configuration of Data Sources section.

See also

Details regarding OpenSearch Data Source are also relevant when resolving possible matches of Data Source provider when the applicable File Reference Types are detected.

Workflow (Chaining Step Processes)

Todo

add details, explanation done in below reference

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

The first main components is the class: CommandLineTool that tells Weaver it will be an atomic 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.

Script Application

When deploying a CommandLineTool that only needs to execute script or shell commands, it is recommended to define an appropriate DockerRequirement to containerize the Process, even though no advanced operation is needed. The reason for this is because there is no way for Weaver to otherwise know for sure how to provide all appropriate dependencies that this operation might need. In order to preserve processing environment and results separate between any Process and Weaver itself, the executions will either be automatically containerized (with some default image), or blocked entirely when Weaver cannot resolve the appropriate execution environment. Therefore, it is recommended that the Application Package provider defines a specific image to avoid unexpected failures if this auto-resolution changes across versions.

Below are minimalistic Application Package samples that make use of a shell command and a custom Python script for quickly running some operations, without actually needing to package any specialized Docker image.

The first example simply outputs the contents of a file input using the cat command. Because the Docker image debian:stretch-slim is specified, we can guarantee that the command will be available within its containerized environment. In this case, we also take advantage of the stdout.log which is always collected by Weaver (along with the stderr) in order to obtain traces produced by any Application Package when performing Job executions.

Sample CWL definition of a shell script
#!/usr/bin/env cwl-runner
cwlVersion: v1.0
class: CommandLineTool
baseCommand: cat
requirements:
  DockerRequirement:
    dockerPull: "debian:stretch-slim"
inputs:
  - id: file
    type: File
    inputBinding:
      position: 1
outputs:
  - id: output
    type: File
    outputBinding:
      glob: output.txt
stdout: output.txt

The second example takes advantage of the InitialWorkDirRequirement to generate a Python script dynamically (i.e.: script.py), prior to executing it for processing the received inputs and produce the output file. Because a Python runner is required, the DockerRequirement specification defines a basic Docker image that meets our needs. Note that in this case, special interpretation of $(...) entries within the definition can be provided to tell CWL how to map Job input values to the dynamically created script.

Sample CWL definition of a Python script
#!/usr/bin/env cwl-runner
cwlVersion: v1.0
class: CommandLineTool
baseCommand:
  - python3
  - script.py
inputs:
  - id: amount
    type: int
  - id: cost
    type: float
outputs:
  - id: quote
    type: File
    outputBinding:
      glob: report.txt
requirements:
  DockerRequirement:
    dockerPull: "python:3.7-alpine"
  InitialWorkDirRequirement:
    listing:
      # below script is generated dynamically in the working directory, and then called by the base command
      - entryname: script.py
        entry: |
          amount = $(inputs.amount)
          cost = $(inputs.cost)
          with open("report.txt", mode="w", encoding="utf-8") as report:
              report.write(f"Order Total: {amount * cost:0.2f}$\\n")
Dockerized Applications

When advanced processing capabilities and more complicated environment preparation are required, it is recommended to package and push pre-built Docker images to a remote registry. In this situation, just like for Script Application examples, the DockerRequirement is needed. The definitions would also be essentially the same as previous examples, but with more complicated operations and possibly larger amount of inputs or outputs.

Whenever a Docker image reference is detected, Weaver will ensure that the application will be pulled using CWL capabilities in order to run it.

Because Application Package providers could desire to make use of Docker images hosted on private registries, Weaver offers the capability to specify an authorization token through HTTP request headers during the Process deployment. More specifically, the following definition can be provided during a Deploy request.

POST /processes HTTP/1.1
Host: weaver.example.com
Content-Type: application/json;charset=UTF-8
X-Auth-Docker: Basic <base64_token>

{ "processDescription": { }, "executionUnit": { } }

The X-Auth-Docker header should be defined exactly like any typical Authorization headers (HTTP Authentication Schemes). The name X-Auth-Docker is inspired from existing implementations that employ X-Auth-Token in a similar fashion. The reason why Authorization and X-Auth-Token headers are not themselves employed in this case is to ensure that they do not interfere with any proxy or server authentication mechanism, which Weaver could be located behind.

For the moment, only Basic (RFC 7617) authentication is supported. To generate the base64 token, following methods can be used:

Command Line
echo -n "<username>:<password>" | base64
Python
import base64
base64.b64encode(b"<username>:<password>")

When the HTTP X-Auth-Docker header is detected in combination of a DockerRequirement entry within the Application Package of the Process being deployed, Weaver will parse the targeted Docker registry defined in dockerPull and will attempt to identify it for later authentication towards it with the provided token. Given a successful authentication, Weaver should then be able to pull the Docker image whenever required for launching new Job executions.

Note

Weaver only attempts to authenticate itself temporarily at the moment when the Job is submitted to retrieve the Docker image, and only if the image is not already available locally. Because of this, the provided authentication token should have a sufficient lifetime to run the Job at later times, considering any retention time of cached Docker images on the server. If the cache is cleaned, and the Docker image is made unavailable, Weaver will attempt to authenticate itself again when receiving the new Job. It is left up to the developer and Application Package provider to manage expired tokens in Weaver according to their needs. To resolve such cases, the Update Token request or an entire re-deployment of the Process could be accomplished, whichever is more convenient for them.

New in version 4.5: Specification and handling of the X-Auth-Docker header for providing an authentication token.

GPU and Resource dependant Applications

When an Application Package requires GPU or any other minimal set of hardware capabilities, such as in the case of machine learning or high-performance computing tasks, the submitted CWL must explicitly indicate those requirements to ensure they can be met for performing its execution. Similarly, an Application Package that must obtain external access to remote contents must not assume that the connection would be available, and must therefore request network access. Below are examples where such requirements are demonstrated and how to define them.

Sample CWL definition with CUDA capabilities
#!/usr/bin/env cwl-runner
cwlVersion: v1.2
class: CommandLineTool
baseCommand: nvidia-smi
requirements:
  cwltool:CUDARequirement:
    cudaVersionMin: "11.2"
    cudaComputeCapability: "7.5"
    cudaDeviceCountMin: 1
    cudaDeviceCountMax: 4
$namespaces:
  cwltool: "http://commonwl.org/cwltool#"
inputs: {}
outputs:
  output:
    type: File
    outputBinding:
      glob: output.txt
stdout: output.txt
Sample CWL definition with computing resources
#!/usr/bin/env cwl-runner
cwlVersion: v1.2
class: CommandLineTool
baseCommand: "<high-compute-algorithm>"
requirements:
  ResourceRequirement:
    coresMin: 8
    coresMax: 16
    ramMin: 1024
    ramMax: 2048
    tmpdirMin: 128
    tmpdirMax: 1024
    outdirMin: 1024
    outdirMax: 2048
inputs: {}
outputs:
  output:
    type: File
    outputBinding:
      glob: output.txt
stdout: output.txt
Sample CWL definition with network access
#!/usr/bin/env cwl-runner
cwlVersion: v1.2
class: CommandLineTool
baseCommand: curl
requirements:
  NetworkAccess:
    networkAccess: true
inputs:
  url:
    type: string
outputs:
  output:
    type: File
    outputBinding:
      glob: "output.txt"
stdout: "output.txt"

Above requirements can be combined in any fashion as needed. They can also be combined with any other requirements employed to define the core components of the application.

Whenever possible, requirements should be provided with values that best match the minimum and maximum amount of resources that the Application Package operation requires. More precisely, over-requesting resources should be avoided as this could lead to failing Job execution if the server or worker node processing it deems it cannot fulfill the requirements because they are too broad to obtain proper resource assignation, because it has insufficient computing resources, or simply for rate-limiting/fair-share reasons.

Although definitions such as ResourceRequirement and cwltool:CUDARequirement are usually applied for atomic operations, they can also become relevant in the context of CWL Workflow execution. Effectively, providing the required hardware capabilities for each atomic application can allow the Workflow engine to better schedule Job steps. For example, if two computationally heavy steps happened to have no restriction for parallelization based on the Workflow steps definition alone, but that running both of them simultaneously on the same machine would necessarily end up causing an OutOfMemory error due to insufficient resources, those requirements could help preemptively let the engine know to wait until reserved resources become available. As a result, execution of the second task could be delayed until the first task is completed, therefore avoiding the error.

New in version 4.17: Support of ResourceRequirement.

New in version 4.27: Support of NetworkAccess and cwltool:CUDARequirement.

Changed in version Deprecated: DockerGpuRequirement.

Warning

Any Application Package that was making use of DockerGpuRequirement should be updated to employ the official DockerRequirement in combination with cwltool:CUDARequirement. For backward compatibility, any detected DockerGpuRequirement definition will be updated automatically with a minimalistic cwltool:CUDARequirement definition using a very lax set of CUDA capabilities. It is recommended to provide specific configurations for your needs.

Remote Applications

To define an application that refers to a Remote Provider, an WPS-1/2, an OGC API - Processes (WPS-REST, WPS-T, WPS-3) or an ESGF-CWT endpoint, the corresponding Weaver-specific CWL-like requirements must be employed to indicate the URL where that remote resource is accessible. Once deployed, the contained CWL package and the resulting Process will be exposed as a OGC API - Processes (WPS-REST, WPS-T, WPS-3) resource.

Upon reception of a Process Execution request, Weaver will take care of resolving the indicated process URL from the CWL requirement and will dispatch the execution to the resource after applying any relevant I/O, parameter and Media-Type conversion to align with the target server standard for submitting the Job requests.

Below are examples of the corresponding CWL requirements employed for each type of remote application.

WPS-1/2 Package Definition
cwlVersion: "v1.0"
class: CommandLineTool
hints:
  WPS1Requirement:
    provider: "https://example.com/ows/wps/catalog"
    process: "getpoint"
OGC API Package Definition
cwlVersion: "v1.0"
class: CommandLineTool
hints:
  OGCAPIRequirement:
    process: "https://example.com/ogcapi/processes/getpoint"
ESGF-CWT Package Definition
{
  "cwlVersion": "v1.0",
  "class": "CommandLineTool",
  "hints": {
    "ESGF-CWTRequirement": {
      "provider": "https://edas.nccs.nasa.gov/wps/cwt",
      "process": "xarray.subset"
    }
  }
}
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    "cwlVersion": "v1.0",
 3    "class": "Workflow",
 4    "requirements": [
 5        {
 6            "class": "StepInputExpressionRequirement"
 7        }
 8    ],
 9    "inputs": {
10        "tasmax": {
11            "type": {
12                "type": "array",
13                "items": "File"
14            }
15        },
16        "lat0": "float",
17        "lat1": "float",
18        "lon0": "float",
19        "lon1": "float",
20        "freq": {
21            "default": "YS",
22            "type": {
23                "type": "enum",
24                "symbols": ["YS", "MS", "QS-DEC", "AS-JUL"]
25            }
26        }
27    },
28    "outputs": {
29        "output": {
30            "type": "File",
31            "outputSource": "ice_days/output_netcdf"
32        }
33    },
34    "steps": {
35        "subset": {
36            "run": "ColibriFlyingpigeon_SubsetBbox.cwl",
37            "in": {
38                "resource": "tasmax",
39                "lat0": "lat0",
40                "lat1": "lat1",
41                "lon0": "lon0",
42                "lon1": "lon1"
43            },
44            "out": ["output"]
45        },
46        "json2nc": {
47            "run": "jsonarray2netcdf",
48            "in": {
49                "input": "subset/output"
50            },
51            "out": ["output"]
52        },
53        "ice_days": {
54            "run": "Finch_IceDays.cwl",
55            "in": {
56                "tasmax": "json2nc/output",
57                "freq": "freq"
58            },
59            "out": ["output_netcdf"]
60        }
61    }
62}

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/{processID}/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 Deploy nor 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 (i.e.: <type>[]), 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, either a mapping or list of I/O are also expected with unique id.

Changed in version 4.0: Previous versions only supported WPS I/O using the listing format. Both can be used interchangeably in both CWL and WPS contexts as of this version.

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

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 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 to infer types. 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 CWL specification.

Warning

Weaver does not support CWL type: Any. This limitation is intentional in order to guarantee proper resolution of CWL types to their corresponding WPS definitions. Furthermore, the Any type would make the Process description too ambiguous.

Type Correspondance

A summary of applicable types is presented below.

Those CWL types can be mapped to WPS and/or OAS contexts in order to obtain corresponding I/O definitions. However, not every type exists in each of those contexts. Therefore, some types will necessarily be simplified or converted to their best corresponding match when exact mapping cannot be accomplished. The simplification of types can happen when converting in any direction (CWL ⇔ WPS ⇔ OAS). It all depends on which definitions that were provided are the more specific. For example, a WPS dateTime will be simplified to a generic CWL string, and into an OAS string with format: "date-time". In this example, it would be important to provide the WPS or OAS definitions if the date-time portion was critical, since it could not be inferred only from CWL string.

Further details regarding handling methods or important considerations for specific types will be presented in Type Resolution and Directory Type sections.

CWL type

WPS data type and sub-type (1)

OAS type

Description

Any

n/a

n/a

Not supported. See note.

null

n/a

n/a

Cannot be used by itself.
Represents optional I/O when combined with other types (2).

boolean

Literal
(bool, boolean)

boolean

Binary value.

int, long

Literal
(int, integer, long, positiveInteger, nonNegativeInteger)

integer, number
(format: int32, int64) (3)

Numeric whole value.
Unless when explicit conversion between contextes can accomplished, the generic integer will be employed.

float, double

Literal
(float, double, scale, angle)

number
(format: float, double) (3)

Numeric floating-point value. By default, float is used unless more explicit context conversion can be accomplished (4).

string

Literal
(string, date, time, dateTime, anyURI)

string
(format: date, time, datetime, date-time, full-date, uri, url, etc.) (5)

Generic string. Default employed if nothing more specific is resolved.

This type can be used to represent any File Reference as plain URL string without resolution.

n/a

BoundingBox

JSON (6)

Only partial support available.
See note.

File

Complex

JSON (6)

File Reference with Media-Type validation and staging according to the applicable scheme.

Directory

Complex

JSON (6)

Directory Reference handled as nested Files to stage.

(1) Resolution method according to critical fields defined in Type Resolution.
(2) More details in Basic Type Definitions and Multiple and Optional Values sections.
(3) Number is used in combination with format to find best match between integer and floating point values. If not provided, it defaults to float to handle both cases.
(4) The float name is employed loosely to represent any floating-point value rather than single-precision (16-bits). Its internal representation is double-precision (32-bits) given that the implementation is in Python.
(5) Because string is the default, any format and pattern can be specified. More specific types with these items can help apply additional validation, although not strictly enforced.
(6) Specific schema required as described in JSON Types.
Type Resolution

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

Note

As of the current version of Weaver, WPS data type BoundingBox is not completely supported. The schema definition exists in WPS and OAS contexts 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] in the meantime.

As presented in previous examples, I/O in the WPS context does not require an explicit indication of which data type from one of Literal, BoundingBox and Complex to apply. Instead, WPS type can be inferred using the matched API schema of the I/O. For instance, Complex I/O (e.g.: 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.

WPS Complex Data Type
1{
2  "id": "input",
3  "formats": [
4    {"mediaType": "application/json", "default": true}
5  ]
6}

A combination of supportedCRS objects providing crs references would otherwise indicate a BoundingBox I/O (see note).

WPS BoundingBox Data Type
1{
2  "id": "input",
3  "supportedCRS": [
4    {"crs": "http://www.opengis.net/def/crs/OGC/1.3/CRS84", "default": true}
5  ]
6}

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  "id": "input",
3  "literalDataDomains": [
4    {"dataType": {"name": "integer"}}
5  ]
6}

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 during Process Deployment 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.

New in version 4.16.

With more recent versions of Weaver, it is also possible to employ OpenAPI schema definitions provided in the WPS I/O to specify the explicit structure that applies to Literal, BoundingBox and Complex data types. When OpenAPI schema are detected, they are also considered in the merging strategy along with other specifications provided in CWL and WPS contexts. More details about OAS context is provided in Inputs/Outputs OpenAPI Schema section.

Directory Type

Changed in version 4.27: Support of CWL type: Directory added to Weaver.

In order to map a Directory to the underlying WPS Process that do not natively offer this type of reference, a Complexpseudo-file” using Media-Type application/directory is employed. For further validation that a Directory is properly parsed by Weaver, provided URL references must also end with a trailing slash (/) character.

Warning

Note that, when using Directory type, very few format and content validation can be accomplished for individual files contained in that directory. The contents must therefore match the definitions expected by the application receiving it. No explicit validation is accomplished by Weaver to ensure if expected contents are available.

When a Directory type is specified in the Process definition, and that a File Reference is provided during Execution, the reference pointed to as Directory must provide a listing of files. Those files can either be relative to the Directory or other absolute File Reference locations. The applicable scheme to stage those files will be applied as needed based on resolved references. It is therefore possible to mix URL schemes between the listed references. For example, a Directory listing as JSON obtained from a https:// endpoint could provide multiple File locations from s3:// buckets to stage for Process Execution.

The following Directory listing formats are supported.

Listing Format

Description

HTML File Index
<html lang="en">
<body>
  <h1>Index of /dir/</h1>
  <hr>
  <table>
  <thead>
    <tr>
      <th>Content</th>
      <th>Modified</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><pre><a href="README">README</a></pre></td>
      <td>2022-10-31 23:48</td>
    </tr>
    <tr>
      <td><pre><a href="dir/">dir/</a></pre></td>
      <td>2022-10-31 23:48</td></tr>
    <tr>
      <td><pre><a href="dir/file.txt">dir/file.txt</a></pre></td>
      <td>2022-10-31 23:48</td>
    </tr>
  </tbody>
  </table>
  <hr>
</body>
</html>

A file index where each reference to be staged should be contained in a <a href="{ref}"/> tag.

The structure can be contained in a <table>, an HTML list (<ol>, <ul>), plain list of <a> hyperlinks, and can contain any amount of CSS or nested HTML tags.

JSON File List
[
  "https://example.com/base/dir/README.md",
  "https://example.com/base/dir/nested/image.png",
  "https://example.com/base/dir/nested/data.csv"
]

A JSON body returned from an endpoint obtained by GET request, which advertises the corresponding Content-Type: application/json header. Each listed file to be staged should also be accessible on provided endpoints.

AWS S3 Bucket
{
  "ResponseMetadata": {
    "RequestId": "vpiM5RBkJ3O68CnD5fO42d887Jh49Cf8bhA6nw7ZTHIuGRVccDQM",
    "HTTPStatusCode": 200,
    "HTTPHeaders": {
      "x-amzn-requestid": "vpiM5RBkJ3O68CnD5fO42d887Jh49Cf8bhA6nw7ZTHIuGRVccDQM"
    },
    "RetryAttempts": 0
  },
  "IsTruncated": false,
  "Contents": [
    {
      "Key": "dir/file.txt",
      "LastModified": "2022-11-01T04:25:42+00:00",
      "ETag": "\"17404a596cbd0d1e6c7d23fcd845ab82\"",
      "Size": 4,
      "StorageClass": "STANDARD"
    },
    {
      "Key": "dir/sub/file.txt",
      "LastModified": "2022-11-01T04:25:42+00:00",
      "ETag": "\"17404a596cbd0d1e6c7d23fcd845ab82\"",
      "Size": 4,
      "StorageClass": "STANDARD"
    },
    {
      "Key": "dir/sub/nested/file.txt",
      "LastModified": "2022-11-01T04:25:42+00:00",
      "ETag": "\"17404a596cbd0d1e6c7d23fcd845ab82\"",
      "Size": 4,
      "StorageClass": "STANDARD"
    }
  ],
  "Name": "wps-process-test-bucket",
  "Prefix": "dir/",
  "MaxKeys": 1000,
  "EncodingType": "url",
  "KeyCount": 3
}

Any supported S3 endpoint as detailed in AWS S3 Bucket Access Methods that provides a listing of file objects to be staged. Proper access must be granted as per Configuration of AWS S3 Buckets if the bucket contents are not publicly accessible. More details about supported references can be found in AWS S3 Bucket References.

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.

Note

For OGC API - Processes conformance and backward compatible support, both mimeType and mediaType can be used interchangeably for Process Deployment. For Process Description, the employed name depends on the requested schema as query parameter, defaulting to OGC API - Processes mediaType representation if unspecified.

Following is an example where input definitions are equivalent in both CWL and WPS contexts.

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

As demonstrated, both contexts accept multiple formats for inputs. These effectively represent supported formats by the underlying application. The two Media-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 Media-types than full ontology references. Weaver has a large set of commonly employed Media-Types that it knows how to convert to corresponding ontologies. Also, Weaver will look for new Media-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 formats is a required field for WPS ComplexData definitions (see Inputs/Outputs Type) and that Media-Types are easier to provide in this context, it is recommended to provide all of them in the WPS definition. Alternatively, the Inputs/Outputs OpenAPI Schema representation also located within the WPS I/O definitions can be used to provide contentMediaType.

Above examples present the minimal content of formats JSON objects (i.e.: mimeType or mediaType value), but other fields, such as encoding and schema can be provided as well to further refine the specific format supported by the corresponding I/O definition. These fields are directly mapped, merged and combined against complementary details provided with contentMediaType, and contentEncoding and contentSchema within an OAS schema (see Inputs/Outputs OpenAPI Schema).

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 Literal data 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  "id": "input",
3  "literalDataDomains": [
4    {"allowedValues": ["value-1", "value-2"]}
5  ]
6}
CWL Enum Values
1{
2  "id": "input",
3  "type": {
4    "type": "enum",
5    "symbols": ["value-1", "value-2"]
6  }
7}

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.

Warning

Ensure to specify "null" with quotes when working with JSON, YAML and CWL file formats and/or contents submitted to API requests or with the CLI. Using an unquoted null will result into a parsed None value which will not be detected as nullable CWL type.

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

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.

Inputs/Outputs OpenAPI Schema

New in version 4.16.

Basic Type Definitions

Alternatively to parameters presented in previous sections, and employed for representing Multiple and Optional Values, Allowed Values specifications, supported File Format definitions and/or Inputs/Outputs Type identification, the OpenAPI specification can be employed to entirely define the I/O schema. More specifically, this is accomplished by providing an OAS-compliant structure under the schema field of each corresponding I/O. This capability allows each Process to be compliant with OGC API - Processes specification that requires this detail in the Process Description. The same kind of schema definitions can be used for the Deploy operation.

For example, the below representations are equivalent between WPS, OAS and CWL definitions. Obviously, corresponding definitions can become more or less complicated with multiple combinations of corresponding parameters presented later in this section. Some definitions are also not completely portable between contexts.

WPS Input
 1{
 2  "id": "input",
 3  "literalDataDomains": [
 4    {
 5       "allowedValues": [
 6         "value-1",
 7         "value-2"
 8       ]
 9    }
10  ],
11  "minOccurs": 2,
12  "maxOccurs": 4
13}
OAS Input
 1{
 2  "id": "input",
 3  "schema": {
 4    "type": "array",
 5    "items": {
 6      "type": "string",
 7      "enum": [
 8        "value-1",
 9        "value-2"
10      ]
11    },
12    "minItems": 2,
13    "maxItems": 4
14  }
15}
CWL Input
 1{
 2  "id": "input",
 3  "type": {
 4    "type": "array",
 5    "items": {
 6      "type": "enum",
 7      "symbols": [
 8        "value-1",
 9        "value-2"
10      ]
11    }
12  }
13}

See also

An example with extensive variations of supported I/O definitions with OAS is available in tests/functional/application-packages/EchoProcess/describe.yml. This is also the corresponding example provided by OGC API - Processes standard to ensure Weaver complies to its specification.

As per all previous parameters in CWL and WPS contexts, details provided in OAS schema are complementary and Weaver will attempt to infer, combine and convert between the various representations as best as possible according to the level of details provided.

Furthermore, Weaver will extend (as needed) any provided schema during Process Deployment if it can identify that the specific OAS definition is inconsistent with other parameters. For example, if minOccurs/maxOccurs were provided by indicating that the I/O must have exactly between [2-4] elements, but only a single OAS object was defined under schema, that OAS definition would be converted to the corresponding array, as single values are not permitted in this case. Similarly, if the range of items was instead [1-4], the OAS definition would be adjusted with oneOf keyword, allowing both single value and array representation of those values, when submitted for Process Execution.

Below is a summary of fields that are equivalent or considered to identify similar specifications (corresponding fields are aligned in the table). Note that all OAS elements are always nested under the schema field of an I/O, with parameters located where appropriate as per OpenAPI specification. Other OAS fields are still permitted, but are not explicitly handled to search for corresponding definitions in WPS and CWL contexts.

Parameters in WPS Context

Parameters in OAS Context

Parameters in CWL Context

minOccurs/maxOccurs

  • minOccurs=0

  • maxOccurs>1 or unbounded

type/oneOf combination

  • single type unless minItems=0

  • minItems/maxItems (array)

type modifiers:

  • ?/"null" if min*=0

  • []/array if max*>1

formats

  • mimeType/mediaType

  • encoding

  • schema

oneOf (for each format)

  • contentMediaType

  • contentEncoding

  • contentSchema

format

  • namespaced mediaType

  • n/a

  • full-URI format/$schema

literalDataDomains

  • allowedValues (int/float/str)

  • allowedValues (range)
    • minimumValue

    • maximumValue

    • spacing

    • rangeClosure
      (combination of open, closed, open-closed, closed-open)

  • valueDefinition (name)

  • default


  • enum array of values


  • minimum value

  • maximum value

  • multipleOf value

  • exclusiveMinimum/ exclusiveMaximum
    (set true for corresponding “open”)


  • type/format combination

  • default


  • enum type with symbols


  • n/a

  • n/a

  • n/a

  • n/a




  • type (simplified as needed)

  • default and ?/"null"

In order to be OGC-compliant, any previously deployed Process will automatically generate any missing schema specification for all I/O it employs when calling its Process Description. Similarly, a deployed Process that did not make use of the schema representation method to define its I/O will also generate the corresponding OAS definitions from other WPS and CWL contexts, provided those definitions offered sufficiently descriptive and valid I/O parameters for deployment.

JSON Types

Along above parameter combinations, OAS context also accomplishes the auto-detection of common JSON structures to convert between raw-data string formatted as JSON, literal JSON object embedded in the body, and application/json file references toward the corresponding Complex WPS input or output. When any of those three JSON definition is detected, other equivalent representations will be added using a oneOf keyword if they were not already explicitly provided in schema. When analyzing and combining those definitions, any OAS $ref or contentSchema specifications will be used to resolve the corresponding type: object with the most explicit schema definition available. If this cannot be achieved, a generic object allowing any additionalProperties (i.e.: no JSON schema variation) will be used instead. External URIs pointing to an OAS schema formatted either as JSON or YAML are resolved and fetched inline as needed during I/O merging strategy to interpret specified references.

Following is a sample representation of equivalent variants JSON definitions, which would be automatically expended using the oneOf structure with other missing components if applicable.

JSON Complex Input with schema reference
 {
   "id:" "input",
   "schema": {
     "oneOf": [
       {
         "type": "string",
         "contentMediaType": "application/json"
         "contentSchema": "http://host.com/schema.json"
       },
       {
         "$ref": "http://host.com/schema.json"
       }
     ]
   }
 }
Generic JSON Complex Input
 {
   "id:" "input",
   "schema": {
     "oneOf": [
       {
         "type": "string",
         "contentMediaType": "application/json"
       },
       {
         "type": "object",
         "additionalProperties": true
       }
     ]
   }
 }

Special handling of well-known OAS type: object structures is also performed to convert them to more specific and appropriate WPS types intended for their purpose. For instance, a measurement value provided along with an Unit of Measure (UoM) is converted to a WPS Literal. An object containing bbox and crs fields with the correct schema are converted to WPS BoundingBox type. Except for these special cases, all other OAS type: object are otherwise converted to WPS Complex type, which in turn is communicated to the CWL application using a File I/O. Other non-JSON definitions are also converted using the same WPS Complex/CWL File, but their values cannot be submitted with literal JSON structures during Process Execution, only using raw-data (i.e: encoding string) or a file reference.

See also

File tests/functional/application-packages/EchoProcess/describe.yml provides example I/O definitions for mentioned special OAS interpretations and more advanced JSON schemas with nested OAS keywords.

File References

It is important to consider that all OAS schema that can be provided during a Deploy request or retrieved from a Process Description only define the expected value representations of the I/O data to be submitted for Execution request. In other words, an I/O typed as Complex that can be submitted using any of the supported File Reference Types to be forwarded to CWL SHOULD NOT add any URI-related definition in schema. It is implicit for every Process that an I/O of given supported Media-Types can be submitted by reference using a link pointing to contents of such types. This implicit file reference interpretation serves multiple purposes.

  1. Using only expected value definition and leaving out the by-reference equivalent greatly simplifies the schema definitions since every single Complex I/O does not need to provide a very verbose schema containing a oneOf(file-ref,raw-data) representation to indicate that data can be submitted both by value or by reference.

  2. Using a generic {"type": "string", "format": "uri"} OAS schema does not convey the Media-Types requirements as well as inferring them “link-to” {"type": "string", "contentMediaType: <format>}. It is therefore better to omit them entirely as they do not add any I/O descriptive value.

  3. Because the above string-formatted uri are left out from definitions, it can instead be used explicitly in an I/O specification to indicate to Weaver that the Process uses a Literal URI string, that must not be fetched by Weaver, and must be passed down as plain string URI directly without modification or interpretation to the underlying CWL Application Package.

To summarize, strings with format: uri will NOT be considered as Complex I/O by Weaver. They will be seen as any other string Literal, but this allows a Process describing its I/O as an external URI reference. This can be useful for an application that handles itself the retrieval of the resource referred to by this URI. To represent supported formats of Complex file references, the schema should be represented using the following structures. If the contentMediaType happens to be JSON, then the explicit OAS object schema can be added as well, as presented in JSON Types section.

Single Format Complex Input
{
  "id:" "input",
  "schema": {
    "type": "string",
    "contentMediaType": "image/png",
    "contentEncoding": "base64"
  }
}
Multiple Supported Format Complex Input
{
  "id:" "input",
  "schema": {
    "oneOf": [
      {
        "type": "string",
        "contentMediaType": "application/gml+xml"
      },
      {
        "type": "string",
        "contentMediaType": "application/kml+xml"
      }
    ]
  }
}
Metadata

Metadata fields are transferred between WPS (from Process description) and CWL (from Application Package) when match is possible. Per I/O definition that support certain metadata fields (notably descriptions), are also transferred.

Note

Because the schema (OAS) definitions are embedded within WPS I/O definitions, corresponding metadata fields ARE NOT transferred. This choice is made in order to keep schema succinct such that they only describe the structure of the expected data type and format, and to avoid too much metadata duplication for each I/O in the resulting Process description.

Below is a list of compatible elements.

Parameters in WPS Context

Parameters in CWL Context

keywords

s:keywords (expecting s in $namespace referring to http://schema.org [2])

metadata (using title and href fields)

$schemas/$namespace (using namespace name and HTTP references)

title

label

abstract/description

doc

Footnotes

Quotation and Billing

Quote Estimation

Todo

  • purpose/description

  • Detail Quote Estimator

Quote Estimator Model

Todo

models vs constants, Open Neural Network Exchange (ONNX) generalization

Quote Estimator Configuration

Todo

describe

---
$id: "https://github.com/crim-ca/weaver/schemas/quotation/quote-estimator.yaml"
$schema: http://json-schema.org/draft-07/schema#
title: Parameters
description: |
  Definitions employed to compute a quote estimation for a given process.
  
  The specific hyper-parameters for estimating the quote must be provided.
  Any estimator definition should be obtained from relevant data analysis of previous execution
  runs of the process or any desired constant value based on business logic for using this process.
  
  The general formulas applied are:
    
    DURATION_ESTIMATE = duration_rate x ( duration_estimator([input_features]) | duration_constant )
    MEMORY_ESTIMATE   = memory_rate   x ( memory_estimator([input_features])   | memory_constant   )
    STORAGE_ESTIMATE  = storage_rate  x ( storage_estimator([input_features])  | storage_constant  )
    CPU_USE_ESTIMATE  = cpu_rate      x ( cpu_estimator([input_features])      | cpu_constant      )
    GPU_USE_ESTIMATE  = gpu_rate      x ( gpu_estimator([input_features])      | gpu_constant      )
    <CUSTOM>_ESTIMATE = [custom]_rate x ( <custom>_estimator([input_features]) | <custom>_constant )
    
    QUOTE_COST        = flat_rate
                      + DURATION_ESTIMATE
                      + MEMORY_ESTIMATE
                      + STORAGE_ESTIMATE
                      + CPU_USE_ESTIMATE
                      + GPU_USE_ESTIMATE
                      + [<CUSTOM>_ESTIMATE ...]
  
  Where each 'Estimator' can be a distinct ONNX model that takes the specified input features of the process,
  which should themselves be mapped onto the actual process input definitions, to predict the relevant value.
  Using 'Estimator' models, it is possible to approximate future process execution and resources requirements
  based on submitted inputs for the quote. The 'Constant' definitions can also be used for resources that are
  known to be invariant to input features. A set of common rates and estimator names are offered, but any custom
  evaluation can be performed as long as their property names finish with the respective naming convention.
  
  Using the 'Constant' definitions, it is also possible to employ a similar formulation as during the estimation
  for evaluating the *real* process execution cost. In this case, the utility should be called by replacing all
  instances of the 'Estimator' definitions by the corresponding *real* value obtained by the process following 
  its execution. Using the same rates as during the quote estimation, the total cost can be calculated.
  
  Example:
  ========
  
    Assumes a process that takes a single file with an estimated running cost that depends only on the duration.
    The first operation is computed before the execution to obtain an estimated quote to run the process. After,
    the quote was agreed and its execution was completed, the real cost of operation can be computed using the 
    corresponding formulation.
    
    Quote Estimation:
    -----------------
    
      config:
        flat_rate: 10 ($)
        duration_rate: 0.01 ($/s)
        duration_estimator: LinearRegression(<duration> = -1E-6 * <input-size> ^ -2 + 3E-6 * <input-size> + 125)
      inputs:
        data:  # input ID
          size: 209715200 (200 MiB)
      
      DURATION_ESTIMATE (s) = 5E-4 * [ (1E-5 * (200 * 2^20) ^ 2 + 3E-4 * (200 * 2^20) + 125) ] = 754.1456 s
      QUOTE_COST = 10 + 0.01 * 754.1456 = 17.54 $
  
    Real Execution Cost:
    --------------------
    
      config:
        flat_rate: 10 ($)
        duration_rate: 0.01 ($/s)
        duration_estimator: 739 s  [monitored duration after the real execution completed]
      inputs:
        data:  # input ID
          size: 209715200 (200 MiB)  [should be the same input as during quote estimation]
      
      TOTAL = 10 + 0.01 * 739 = 17.39 $

type: object
additionalProperties: false
required:
  - config
  - inputs
properties:
  $schema:
    type: string
    enum:
      - "https://github.com/crim-ca/weaver/schemas/quotation/quote-estimator.yaml"
      - "https://github.com/crim-ca/weaver/blob/master/schemas/quotation/quote-estimator.yaml"
      - "https://raw.githubusercontent.com/crim-ca/weaver/master/schemas/quotation/quote-estimator.yaml"
  config:
    $ref: "#/definitions/Configuration"
  inputs:
    $ref: "#/definitions/Inputs"
  outputs:
    $ref: "#/definitions/Outputs"
definitions:
  Configuration:
    description: |
      Defines the hyper-parameters employed for estimating a quote for a process according to provide inputs.
    type: object
    minProperties: 1
    properties:
      flat_rate:
        description: Flat cost applied to every estimation ($).
        $ref: "#/definitions/Constant"
      duration_rate:
        description: Ratio of the cost of execution time per second ($/s).
        $ref: "#/definitions/Constant"
      duration_estimator:
        description: An estimator that provides the total duration (seconds) for the process job execution.
        $ref: "#/definitions/Estimator"
      memory_rate:
        description: Ratio of the cost of memory per used byte ($/b).
        $ref: "#/definitions/Constant"
      memory_estimator:
        description: An estimator that provides the memory usage (bytes) for the process job execution.
        $ref: "#/definitions/Estimator"
      storage_rate:
        description: Ratio of the cost of storage per used byte ($/b).
        $ref: "#/definitions/Constant"
      storage_estimator:
        description: An estimator that provides the storage requirements (bytes) for the process job execution.
        $ref: "#/definitions/Estimator"
      cpu_rate:
        description: Ratio of the cost of a CPU per used quantity ($/unit).
        $ref: "#/definitions/Constant"
      cpu_estimator:
        description: An estimator that provides the CPU usage requirements (amount) for the process job execution.
        $ref: "#/definitions/Estimator"
      gpu_rate:
        description: Ratio of the cost of a GPU per used quantity ($/unit).
        $ref: "#/definitions/Constant"
      gpu_estimator:
        description: An estimator that provides the GPU usage requirements (amount) for the process job execution.
        $ref: "#/definitions/Estimator"
    patternProperties:
      "^[A-Za-z_-][A-Za-z0-9_-]*_rate$":
        description: Ratio of the cost of a custom criteria.
        $ref: "#/definitions/Constant"
      "^[A-Za-z_-][A-Za-z0-9_-]*_estimator$":
        description: An estimator that provides the custom criteria evaluation for the process job execution.
        $ref: "#/definitions/Estimator"
    additionalProperties: false
  Estimator:
    summary: Estimator configuration.
    description: |
      The estimator should output a single numeric value.
      This value can be provided literally (constant), or predicted by an arbitrary model.
      When using a model the input features should correspond to the specified 'inputs' of the configuration.
    oneOf:
      - $ref: "#/definitions/EstimatorModel"
      - $ref: "#/definitions/Constant"
  EstimatorModel:
    title: Estimator Model
    summary: Model definition to compute an estimation.
    type: object
    additionalProperties: false
    required:
      - model
    properties:
      model:
        summary: Model in ONNX format and represented in JSON.
        $ref: "#/definitions/ModelONNX"
      inputs:
        summary: Mapping of model input names or indices to corresponding process input identifiers.
        description: |
          Mapping of model input names or indices to corresponding process input identifiers.
          The process literal/complex input IDs should correspond to the values/files
          passed to the application for its execution and specified for 'Parameters.inputs'.
          The model input names/indices correspond to the internal ONNX 'graph.input' definitions of the estimator.
          This mapping is used to indicate which subset of input parameters from the process should be used as input
          for the model inference. Process inputs can be repeated over multiple model inputs if needed.
          If omitted, process inputs will all be passed to the model as one-to-one mapping, and must match IDs exactly.
          Otherwise, corresponding process inputs will be passed down to the relevant model input feature vector 
          unless dropped using a null mapping value. In such case, that process input will be ignored for the 
          estimation from this model inference.
        type: object
        additionalProperties:
          oneOf:
            - type: string
            - type: integer
              minimum: 0
            - type: "null"
      output:
        description: |
          Name or index of the model output to employ as estimation value
          in case model inference produces more than one prediction.
          Automatically selects the first item if not specified.
          This output must produce a unique floating point value.
        oneOf:
          - type: string
          - type: integer
            minimum: 0
        default: 0
  ModelONNX:
    summary: Model in ONNX format and represented in JSON.
    description: |
      The model should be converted to ONNX.
      For scikit-learn models, this can be achieved using https://github.com/onnx/sklearn-onnx.
      Then, the obtained ONNX node can be converted to JSON using https://github.com/PINTO0309/onnx2json.
      Other implementations than scikit-learn models should be supported with the standard ONNX format, 
      but they have not been tested extensively.
    type: object
    required:
      - irVersion
      - producerName
      - producerVersion
      - graph
    additionalProperties: true
    properties:
      irVersion:
        type: string
        pattern: "[0-9]+"
      producerName:
        type: string
        examples:
          - skl2onnx
      producerVersion:
        type: string
        pattern: "[0-9]+(\\.[0-9]+)*"
      modelVersion:
        type: string
        pattern: "[0-9]+"
        default: "0"
      domain:
        type: string
        default: ""
      docString:
        type: string
        default: ""
      graph:
        description: ONNX definition of the model nodes.
        type: object
        additionalProperties: true
  Constant:
    summary: A constant value.
    description: |
      Can be employed as alternative to an estimator model for a shorter definition.
      The numeric value is used directly in the same manner as the output of an estimator.
    type: number
    default: 0.0
  InputFeature:
    description: |
      Input details that are used as features for an estimator model.
    oneOf:
      - type: number
      - type: string
      - type: boolean
      - $ref: "#/definitions/InputFeatureLiteral"
      - $ref: "#/definitions/InputFeatureComplex"
      - type: array
        items:
          oneOf:
            - type: number
            - type: string
            - type: boolean
        minItems: 1
      - type: array
        items:
          $ref: "#/definitions/InputFeatureLiteral"
        minItems: 1
      - type: array
        items:
          $ref: "#/definitions/InputFeatureComplex"
        minItems: 1
  InputFeatureLiteral:
    title: InputFeatureLiteral
    description: Feature employed when the provided process input is resolved as a literal value.
    type: object
    additionalProperties: false  # differentiate between size/value
    required:
      - value
    properties:
      value:
        oneOf:
          - type: number
          - type: string
          - type: boolean
      weight:
        type: number
        default: 1.0
      length:
        description: Multiplicative factor in case the input of the process is an array.
        type: integer
        default: 1
  InputFeatureComplex:
    title: InputFeatureComplex
    description: Feature employed when the provided process input is resolved as a file or directory descriptor.
    type: object
    additionalProperties: false  # differentiate between size/value
    required:
      - size
    properties:
      size:
        description: Size in bytes of the contents.
        type: integer
      weight:
        type: number
        default: 1.0
      length:
        description: Multiplicative factor in case the input of the process is an array.
        type: integer
        default: 1
  Inputs:
    title: Inputs
    description: |
      Inputs that will be used as features for the estimators.
      To obtain the array required for loading the feature vector and weights expected by estimators,
      the IDs (keys) of these inputs can be mapped to specific model input names.
      All inputs will be used for the estimator model if no mapping is specified.
    type: object
    additionalProperties:
      $ref: "#/definitions/InputFeature"
  OutputFeature:
    description: |
      Estimated output details using input features, and employed as input features for subsequent quote estimations.
    oneOf:
      - $ref: "#/definitions/OutputFeatureLiteral"
      - $ref: "#/definitions/OutputFeatureComplex"
  OutputFeatureLiteral:
    description: Feature produced by an estimator for a process output literal value.
    type: object
    additionalProperties: false  # differentiate between size/value
    required:
      - value
    properties:
      value:
        description: This estimator should generate a single value that corresponds to the expected process output.
        $ref: "#/definitions/Estimator"
      weight:
        oneOf:
          - $ref: "#/definitions/Estimator"
          - type: number
            default: 1.0
      length:
        description: Multiplicative factor in case the output of the process is an array.
        oneOf:
          - $ref: "#/definitions/Estimator"
          - type: integer
            default: 1
  OutputFeatureComplex:
    description: Feature produced by an estimator for a process output file or directory descriptor.
    type: object
    additionalProperties: false  # differentiate between size/value
    required:
      - size
    properties:
      size:
        description: Size in bytes of the contents.
        $ref: "#/definitions/Estimator"
      weight:
        oneOf:
          - $ref: "#/definitions/Estimator"
          - type: number
            default: 1.0
      length:
        description: Multiplicative factor in case the output of the process is an array.
        oneOf:
          - $ref: "#/definitions/Estimator"
          - type: integer
            default: 1
  Outputs:
    description: |
      Output estimators that can generate input features for subsequent process quote estimations in a workflow chain.
      These estimators will receive the input features and should provide expected result features from the execution.
      The format of the output features must correspond to the expected output types of the process.
      Not required if the estimated quote is only needed for the atomic process.
    type: object
    additionalProperties:
      $ref: "#/definitions/OutputFeature"
Quote Estimation Result

Todo

describe

---
$id: https://raw.githubusercontent.com/crim-ca/weaver/master/schemas/quotation/quote-estimation-result.yaml
$schema: http://json-schema.org/draft-07/schema#
description: |
  Quote Estimation Result produced by an algorithm that takes as input the Quote Estimator configuration.

type: object
required:
  - total
properties:
  total:
    type: number
    minimum: 0.0
  currency:
    description: |
      Currency of the quote.
      If the estimator does not provide a specific currency, the API-wide value will be employed.
      See `weaver.quotation_currency_default` in *Configuration of Quotation Estimation* documentation.
    type: string
    minLength: 3
    maxLength: 3
additionalProperties:
  description: "Additional quotation estimate details with rundown of values contributing in the total cost."
  $ref: "#/definitions/QuoteEstimateValue"

definitions:
  QuoteEstimateValue:
    type: object
    required:
      - cost
    properties:
      estimate:
        type:
          - number
          - "null"
        minimum: 0.0
      rate:
        type:
          - number
          - "null"
        minimum: 0.0
      cost:
        type: number
        minimum: 0.0

Billing

Todo

  • Link between Quotation, Execution and Billing

Currency Conversion

Todo

  • Detail Currency Converter (see weaver/quotation/estimation.py)

API and Examples

Todo

  • Detail API endpoints

  • Example requests

  • include design UML schemas (request/response state flow)

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

Weaver CLI and Client

Once Weaver package is installed (see Installation), it provides a command line interface (CLI) as well as a Python weaver.cli.WeaverClient to allow simplified interactions through shell calls or Python scripts.

This offers to the user methods to use file references (e.g.: local CWL Application Package definition) to rapidly operate with functionalities such as Deploy, Describe, Execute and any other operation described in Managing processes included in Weaver ADES/EMS section.

Note

Technically, any OGC API - Processes implementation could be supported using the provided CLI and weaver.cli.WeaverClient. There are however some operations such as Uploading File to the Vault feature (and any utility that makes use of it) that are applicable only for Weaver instances.

Please refer to following sections for more details.

Python Client Commands

For details about using the Python weaver.cli.WeaverClient, please refer directly to its class documentation and its underlying methods.

Shell CLI Commands

Following are the detail for the shell CLI which provides the same features.

Run Weaver operations.

usage: weaver [-h] [--stdout] [--log LOG]
              [--quiet | --debug | --verbose | --log-level {DEBUG,ERROR,INFO,WARN}]
              [--version]
              {deploy,undeploy,register,unregister,capabilities,processes,describe,package,execute,jobs,monitor,dismiss,status,logs,exceptions,errors,statistics,stats,results,upload}
              ...
Optional Arguments
--version, -V

Display the version of the package.

Logging Arguments

Options that configure output logging.

--stdout

Enforce logging to stdout for display in console.

Default: False

--log, --log-file

Output file to write generated logs.

--quiet, -q

Do not output anything else than error.

Default: False

--debug, -d

Enable extra debug logging.

Default: False

--verbose, -v

Output informative logging details.

Default: False

--log-level, -l

Possible choices: DEBUG, ERROR, INFO, WARN

Explicit log level to employ (default: None, case-insensitive).

Operations

Name of the operation to run.

operation

Possible choices: deploy, undeploy, register, unregister, capabilities, processes, describe, package, execute, jobs, monitor, dismiss, status, logs, exceptions, errors, statistics, stats, results, upload

Sub-commands
deploy

Deploy a process.

weaver deploy [--stdout] [--log LOG]
              [--quiet | --debug | --verbose | --log-level {DEBUG,ERROR,INFO,WARN}]
              [-h] -u URL [-nL | -wL] [-nH | -wH] [-H HEADER]
              [-F {JSON,JSON+RAW,JSON+STR,TEXT,TXT,XML,XML+RAW,XML+STR,YAML,YML}]
              [-rT REQUEST_TIMEOUT] [-rR REQUEST_RETRIES]
              [-aC AUTH_HANDLER_CLASS] [-aI IDENTITY] [-aP PASSWORD]
              [-aU AUTH_URL] [-aM HTTP_METHOD] [-aH HEADER] [-p PROCESS_ID]
              [-b BODY] [--cwl CWL | --wps WPS] [-T TOKEN] [-U USERNAME]
              [-P PASSWORD] [-D]
Logging Arguments

Options that configure output logging.

--stdout

Enforce logging to stdout for display in console.

Default: False

--log, --log-file

Output file to write generated logs.

--quiet, -q

Do not output anything else than error.

Default: False

--debug, -d

Enable extra debug logging.

Default: False

--verbose, -v

Output informative logging details.

Default: False

--log-level, -l

Possible choices: DEBUG, ERROR, INFO, WARN

Explicit log level to employ (default: None, case-insensitive).

Required Arguments
-u, --url

URL of the instance to run operations.

Optional Arguments
-nL, --no-links

Remove “links” section from returned result body.

Default: True

-wL, --with-links

Preserve “links” section from returned result body (default).

Default: True

-nH, --no-headers

Omit response headers, only returning the result body (default).

Default: False

-wH, --with-headers

Return response headers additionally to the result body.

Default: False

-H, --header

Additional headers to apply for sending requests toward the service. This option can be provided multiple times, each with a value formatted as:

‘Header-Name: value’

Header names are case-insensitive. Quotes can be used in the <value> portion to delimit it. Surrounding spaces are trimmed. Note that overridden headers expected by requests and the service could break some functionalities.

-F, --format

Possible choices: JSON, JSON+RAW, JSON+STR, TEXT, TXT, XML, XML+RAW, XML+STR, YAML, YML

Select an alternative output representation (default: JSON+STR, case-insensitive).

JSON: Representation as JSON (object), which can still be manipulated in code.

JSON+RAW: Representation as JSON content formatted as raw string without any indentation or newlines.

JSON+STR: Representation as JSON content formatted as string with indentation and newlines.

TEXT: Representation as plain text content without any specific reformatting or validation.

TXT: Representation as plain text content without any specific reformatting or validation.

XML: Representation as XML content formatted as serialized string.

XML+RAW: Representation as XML content formatted as raw string without indentation or newlines.

XML+STR: Representation as XML content formatted as string with indentation and newlines.

YAML: Representation as YAML content formatted as string with indentation and newlines.

YML: Alias to YAML.

-p, --id, --process

Process identifier for deployment. If no --body is provided, this is required. Otherwise, provided value overrides the corresponding ID in the body.

-b, --body

Deployment body directly provided. Allows both JSON and YAML format when using file reference. If provided in combination with process ID or CWL, they will override the corresponding content. Can be provided either with a local file, an URL or literal string contents formatted as JSON.

--cwl

Application Package of the process defined using Common Workflow Language (CWL) as JSON or YAML format when provided by file reference. File reference can be a local file or URL location. Can also be provided as literal string contents formatted as JSON. Provided contents will be inserted into an automatically generated request deploy body if none was specified with --body option (note: --process must be specified instead in that case). Otherwise, it will override the appropriate execution unit section within the provided deploy body.

--wps

Reference URL to a specific process under a Web Processing Service (WPS) to package as OGC-API Process.

-D, --delete, --undeploy

Perform undeploy step as applicable prior to deployment to avoid conflict with exiting process.

Default: False

Request Arguments

Parameters to control specific options related to HTTP request handling.

-rT, --request-timeout

Maximum timout duration (seconds) to wait for a response when performing HTTP requests (default: 5s).

Default: 5

-rR, --request-retries

Amount of attempt to retry HTTP requests in case of failure (default: no retry).

Service Authentication Arguments

Parameters to obtain access to a protected service using a request authentication handler.

-aC, --auth-class, --auth-handler

Script or module path reference to class implementation to handle inline request authentication. Format [path/to/script.py:module.AuthHandlerClass] or [installed.module.AuthHandlerClass] is expected.

Utility definitions are available as:

weaver.cli.BasicAuthHandler weaver.cli.BearerAuthHandler weaver.cli.CookieAuthHandler

Custom implementations are allowed for more advanced use cases.

-aI, --auth-identity, --auth-username

Authentication identity (or username) to be passed down to the specified Authentication Handler.

-aP, --auth-password

Authentication password to be passed down to the specified Authentication Handler.

-aU, --auth-url

Authentication URL to be passed down to the specified Authentication Handler.

-aM, --auth-method

Possible choices: GET, HEAD, POST, PUT, DELETE

Authentication HTTP request method to be passed down to the specified Authentication Handler (default: GET, case-insensitive).

Default: GET

-aH, --auth-header

Additional headers to apply for sending requests when using the authentication handler. This option can be provided multiple times, each with a value formatted as:

‘Header-Name: value’

Header names are case-insensitive. Quotes can be used in the <value> portion to delimit it. Surrounding spaces are trimmed.

Docker Authentication Arguments

Parameters to obtain access to a protected Docker registry to retrieve the referenced image.

-T, --token

Authentication token to retrieve a Docker image reference from a protected registry during execution.

-U, --username

Username to compute the authentication token for Docker image retrieval from a protected registry.

-P, --password

Password to compute the authentication token for Docker image retrieval from a protected registry.

undeploy

Undeploy an existing process.

weaver undeploy [--stdout] [--log LOG]
                [--quiet | --debug | --verbose | --log-level {DEBUG,ERROR,INFO,WARN}]
                [-h] -u URL [-nL | -wL] [-nH | -wH] [-H HEADER]
                [-F {JSON,JSON+RAW,JSON+STR,TEXT,TXT,XML,XML+RAW,XML+STR,YAML,YML}]
                [-rT REQUEST_TIMEOUT] [-rR REQUEST_RETRIES]
                [-aC AUTH_HANDLER_CLASS] [-aI IDENTITY] [-aP PASSWORD]
                [-aU AUTH_URL] [-aM HTTP_METHOD] [-aH HEADER] -p PROCESS_ID
Logging Arguments

Options that configure output logging.

--stdout

Enforce logging to stdout for display in console.

Default: False

--log, --log-file

Output file to write generated logs.

--quiet, -q

Do not output anything else than error.

Default: False

--debug, -d

Enable extra debug logging.

Default: False

--verbose, -v

Output informative logging details.

Default: False

--log-level, -l

Possible choices: DEBUG, ERROR, INFO, WARN

Explicit log level to employ (default: None, case-insensitive).

Required Arguments
-u, --url

URL of the instance to run operations.

-p, --id, --process

Identifier of the process to run undeploy operation.

Optional Arguments
-nL, --no-links

Remove “links” section from returned result body.

Default: True

-wL, --with-links

Preserve “links” section from returned result body (default).

Default: True

-nH, --no-headers

Omit response headers, only returning the result body (default).

Default: False

-wH, --with-headers

Return response headers additionally to the result body.

Default: False

-H, --header

Additional headers to apply for sending requests toward the service. This option can be provided multiple times, each with a value formatted as:

‘Header-Name: value’

Header names are case-insensitive. Quotes can be used in the <value> portion to delimit it. Surrounding spaces are trimmed. Note that overridden headers expected by requests and the service could break some functionalities.

-F, --format

Possible choices: JSON, JSON+RAW, JSON+STR, TEXT, TXT, XML, XML+RAW, XML+STR, YAML, YML

Select an alternative output representation (default: JSON+STR, case-insensitive).

JSON: Representation as JSON (object), which can still be manipulated in code.

JSON+RAW: Representation as JSON content formatted as raw string without any indentation or newlines.

JSON+STR: Representation as JSON content formatted as string with indentation and newlines.

TEXT: Representation as plain text content without any specific reformatting or validation.

TXT: Representation as plain text content without any specific reformatting or validation.

XML: Representation as XML content formatted as serialized string.

XML+RAW: Representation as XML content formatted as raw string without indentation or newlines.

XML+STR: Representation as XML content formatted as string with indentation and newlines.

YAML: Representation as YAML content formatted as string with indentation and newlines.

YML: Alias to YAML.

Request Arguments

Parameters to control specific options related to HTTP request handling.

-rT, --request-timeout

Maximum timout duration (seconds) to wait for a response when performing HTTP requests (default: 5s).

Default: 5

-rR, --request-retries

Amount of attempt to retry HTTP requests in case of failure (default: no retry).

Service Authentication Arguments

Parameters to obtain access to a protected service using a request authentication handler.

-aC, --auth-class, --auth-handler

Script or module path reference to class implementation to handle inline request authentication. Format [path/to/script.py:module.AuthHandlerClass] or [installed.module.AuthHandlerClass] is expected.

Utility definitions are available as:

weaver.cli.BasicAuthHandler weaver.cli.BearerAuthHandler weaver.cli.CookieAuthHandler

Custom implementations are allowed for more advanced use cases.

-aI, --auth-identity, --auth-username

Authentication identity (or username) to be passed down to the specified Authentication Handler.

-aP, --auth-password

Authentication password to be passed down to the specified Authentication Handler.

-aU, --auth-url

Authentication URL to be passed down to the specified Authentication Handler.

-aM, --auth-method

Possible choices: GET, HEAD, POST, PUT, DELETE

Authentication HTTP request method to be passed down to the specified Authentication Handler (default: GET, case-insensitive).

Default: GET

-aH, --auth-header

Additional headers to apply for sending requests when using the authentication handler. This option can be provided multiple times, each with a value formatted as:

‘Header-Name: value’

Header names are case-insensitive. Quotes can be used in the <value> portion to delimit it. Surrounding spaces are trimmed.

register

Register a remote provider.

weaver register [--stdout] [--log LOG]
                [--quiet | --debug | --verbose | --log-level {DEBUG,ERROR,INFO,WARN}]
                [-h] -u URL [-nL | -wL] [-nH | -wH] [-H HEADER]
                [-F {JSON,JSON+RAW,JSON+STR,TEXT,TXT,XML,XML+RAW,XML+STR,YAML,YML}]
                [-rT REQUEST_TIMEOUT] [-rR REQUEST_RETRIES]
                [-aC AUTH_HANDLER_CLASS] [-aI IDENTITY] [-aP PASSWORD]
                [-aU AUTH_URL] [-aM HTTP_METHOD] [-aH HEADER] -pI PROVIDER_ID
                -pU PROVIDER_URL
Logging Arguments

Options that configure output logging.

--stdout

Enforce logging to stdout for display in console.

Default: False

--log, --log-file

Output file to write generated logs.

--quiet, -q

Do not output anything else than error.

Default: False

--debug, -d

Enable extra debug logging.

Default: False

--verbose, -v

Output informative logging details.

Default: False

--log-level, -l

Possible choices: DEBUG, ERROR, INFO, WARN

Explicit log level to employ (default: None, case-insensitive).

Required Arguments
-u, --url

URL of the instance to run operations.

-pI, --provider

Identifier of a remote provider under which the referred process can be found to run register operation.

-pU, --provider-url

Endpoint URL of the remote provider to register.

Optional Arguments
-nL, --no-links

Remove “links” section from returned result body.

Default: True

-wL, --with-links

Preserve “links” section from returned result body (default).

Default: True

-nH, --no-headers

Omit response headers, only returning the result body (default).

Default: False

-wH, --with-headers

Return response headers additionally to the result body.

Default: False

-H, --header

Additional headers to apply for sending requests toward the service. This option can be provided multiple times, each with a value formatted as:

‘Header-Name: value’

Header names are case-insensitive. Quotes can be used in the <value> portion to delimit it. Surrounding spaces are trimmed. Note that overridden headers expected by requests and the service could break some functionalities.

-F, --format

Possible choices: JSON, JSON+RAW, JSON+STR, TEXT, TXT, XML, XML+RAW, XML+STR, YAML, YML

Select an alternative output representation (default: JSON+STR, case-insensitive).

JSON: Representation as JSON (object), which can still be manipulated in code.

JSON+RAW: Representation as JSON content formatted as raw string without any indentation or newlines.

JSON+STR: Representation as JSON content formatted as string with indentation and newlines.

TEXT: Representation as plain text content without any specific reformatting or validation.

TXT: Representation as plain text content without any specific reformatting or validation.

XML: Representation as XML content formatted as serialized string.

XML+RAW: Representation as XML content formatted as raw string without indentation or newlines.

XML+STR: Representation as XML content formatted as string with indentation and newlines.

YAML: Representation as YAML content formatted as string with indentation and newlines.

YML: Alias to YAML.

Request Arguments

Parameters to control specific options related to HTTP request handling.

-rT, --request-timeout

Maximum timout duration (seconds) to wait for a response when performing HTTP requests (default: 5s).

Default: 5

-rR, --request-retries

Amount of attempt to retry HTTP requests in case of failure (default: no retry).

Service Authentication Arguments

Parameters to obtain access to a protected service using a request authentication handler.

-aC, --auth-class, --auth-handler

Script or module path reference to class implementation to handle inline request authentication. Format [path/to/script.py:module.AuthHandlerClass] or [installed.module.AuthHandlerClass] is expected.

Utility definitions are available as:

weaver.cli.BasicAuthHandler weaver.cli.BearerAuthHandler weaver.cli.CookieAuthHandler

Custom implementations are allowed for more advanced use cases.

-aI, --auth-identity, --auth-username

Authentication identity (or username) to be passed down to the specified Authentication Handler.

-aP, --auth-password

Authentication password to be passed down to the specified Authentication Handler.

-aU, --auth-url

Authentication URL to be passed down to the specified Authentication Handler.

-aM, --auth-method

Possible choices: GET, HEAD, POST, PUT, DELETE

Authentication HTTP request method to be passed down to the specified Authentication Handler (default: GET, case-insensitive).

Default: GET

-aH, --auth-header

Additional headers to apply for sending requests when using the authentication handler. This option can be provided multiple times, each with a value formatted as:

‘Header-Name: value’

Header names are case-insensitive. Quotes can be used in the <value> portion to delimit it. Surrounding spaces are trimmed.

unregister

Unregister a remote provider.

weaver unregister [--stdout] [--log LOG]
                  [--quiet | --debug | --verbose | --log-level {DEBUG,ERROR,INFO,WARN}]
                  [-h] -u URL [-nL | -wL] [-nH | -wH] [-H HEADER]
                  [-F {JSON,JSON+RAW,JSON+STR,TEXT,TXT,XML,XML+RAW,XML+STR,YAML,YML}]
                  [-rT REQUEST_TIMEOUT] [-rR REQUEST_RETRIES]
                  [-aC AUTH_HANDLER_CLASS] [-aI IDENTITY] [-aP PASSWORD]
                  [-aU AUTH_URL] [-aM HTTP_METHOD] [-aH HEADER] -pI
                  PROVIDER_ID
Logging Arguments

Options that configure output logging.

--stdout

Enforce logging to stdout for display in console.

Default: False

--log, --log-file

Output file to write generated logs.

--quiet, -q

Do not output anything else than error.

Default: False

--debug, -d

Enable extra debug logging.

Default: False

--verbose, -v

Output informative logging details.

Default: False

--log-level, -l

Possible choices: DEBUG, ERROR, INFO, WARN

Explicit log level to employ (default: None, case-insensitive).

Required Arguments
-u, --url

URL of the instance to run operations.

-pI, --provider

Identifier of a remote provider under which the referred process can be found to run unregister operation.

Optional Arguments
-nL, --no-links

Remove “links” section from returned result body.

Default: True

-wL, --with-links

Preserve “links” section from returned result body (default).

Default: True

-nH, --no-headers

Omit response headers, only returning the result body (default).

Default: False

-wH, --with-headers

Return response headers additionally to the result body.

Default: False

-H, --header

Additional headers to apply for sending requests toward the service. This option can be provided multiple times, each with a value formatted as:

‘Header-Name: value’

Header names are case-insensitive. Quotes can be used in the <value> portion to delimit it. Surrounding spaces are trimmed. Note that overridden headers expected by requests and the service could break some functionalities.

-F, --format

Possible choices: JSON, JSON+RAW, JSON+STR, TEXT, TXT, XML, XML+RAW, XML+STR, YAML, YML

Select an alternative output representation (default: JSON+STR, case-insensitive).

JSON: Representation as JSON (object), which can still be manipulated in code.

JSON+RAW: Representation as JSON content formatted as raw string without any indentation or newlines.

JSON+STR: Representation as JSON content formatted as string with indentation and newlines.

TEXT: Representation as plain text content without any specific reformatting or validation.

TXT: Representation as plain text content without any specific reformatting or validation.

XML: Representation as XML content formatted as serialized string.

XML+RAW: Representation as XML content formatted as raw string without indentation or newlines.

XML+STR: Representation as XML content formatted as string with indentation and newlines.

YAML: Representation as YAML content formatted as string with indentation and newlines.

YML: Alias to YAML.

Request Arguments

Parameters to control specific options related to HTTP request handling.

-rT, --request-timeout

Maximum timout duration (seconds) to wait for a response when performing HTTP requests (default: 5s).

Default: 5

-rR, --request-retries

Amount of attempt to retry HTTP requests in case of failure (default: no retry).

Service Authentication Arguments

Parameters to obtain access to a protected service using a request authentication handler.

-aC, --auth-class, --auth-handler

Script or module path reference to class implementation to handle inline request authentication. Format [path/to/script.py:module.AuthHandlerClass] or [installed.module.AuthHandlerClass] is expected.

Utility definitions are available as:

weaver.cli.BasicAuthHandler weaver.cli.BearerAuthHandler weaver.cli.CookieAuthHandler

Custom implementations are allowed for more advanced use cases.

-aI, --auth-identity, --auth-username

Authentication identity (or username) to be passed down to the specified Authentication Handler.

-aP, --auth-password

Authentication password to be passed down to the specified Authentication Handler.

-aU, --auth-url

Authentication URL to be passed down to the specified Authentication Handler.

-aM, --auth-method

Possible choices: GET, HEAD, POST, PUT, DELETE

Authentication HTTP request method to be passed down to the specified Authentication Handler (default: GET, case-insensitive).

Default: GET

-aH, --auth-header

Additional headers to apply for sending requests when using the authentication handler. This option can be provided multiple times, each with a value formatted as:

‘Header-Name: value’

Header names are case-insensitive. Quotes can be used in the <value> portion to delimit it. Surrounding spaces are trimmed.

capabilities (processes)

List available processes.

weaver capabilities [--stdout] [--log LOG]
                    [--quiet | --debug | --verbose | --log-level {DEBUG,ERROR,INFO,WARN}]
                    [-h] -u URL [-nL | -wL] [-nH | -wH] [-H HEADER]
                    [-F {JSON,JSON+RAW,JSON+STR,TEXT,TXT,XML,XML+RAW,XML+STR,YAML,YML}]
                    [-rT REQUEST_TIMEOUT] [-rR REQUEST_RETRIES]
                    [-aC AUTH_HANDLER_CLASS] [-aI IDENTITY] [-aP PASSWORD]
                    [-aU AUTH_URL] [-aM HTTP_METHOD] [-aH HEADER] [-P PAGE]
                    [-N LIMIT] [-D]
                    [-O {created,process,id,version,identifier}] [-nP | -wP]
Logging Arguments

Options that configure output logging.

--stdout

Enforce logging to stdout for display in console.

Default: False

--log, --log-file

Output file to write generated logs.

--quiet, -q

Do not output anything else than error.

Default: False

--debug, -d

Enable extra debug logging.

Default: False

--verbose, -v

Output informative logging details.

Default: False

--log-level, -l

Possible choices: DEBUG, ERROR, INFO, WARN

Explicit log level to employ (default: None, case-insensitive).

Required Arguments
-u, --url

URL of the instance to run operations.

Optional Arguments
-nL, --no-links

Remove “links” section from returned result body.

Default: True

-wL, --with-links

Preserve “links” section from returned result body (default).

Default: True

-nH, --no-headers

Omit response headers, only returning the result body (default).

Default: False

-wH, --with-headers

Return response headers additionally to the result body.

Default: False

-H, --header

Additional headers to apply for sending requests toward the service. This option can be provided multiple times, each with a value formatted as:

‘Header-Name: value’

Header names are case-insensitive. Quotes can be used in the <value> portion to delimit it. Surrounding spaces are trimmed. Note that overridden headers expected by requests and the service could break some functionalities.

-F, --format

Possible choices: JSON, JSON+RAW, JSON+STR, TEXT, TXT, XML, XML+RAW, XML+STR, YAML, YML

Select an alternative output representation (default: JSON+STR, case-insensitive).

JSON: Representation as JSON (object), which can still be manipulated in code.

JSON+RAW: Representation as JSON content formatted as raw string without any indentation or newlines.

JSON+STR: Representation as JSON content formatted as string with indentation and newlines.

TEXT: Representation as plain text content without any specific reformatting or validation.

TXT: Representation as plain text content without any specific reformatting or validation.

XML: Representation as XML content formatted as serialized string.

XML+RAW: Representation as XML content formatted as raw string without indentation or newlines.

XML+STR: Representation as XML content formatted as string with indentation and newlines.

YAML: Representation as YAML content formatted as string with indentation and newlines.

YML: Alias to YAML.

-P, --page

Specify the paging index for process listing.

-N, --number, --limit

Specify the amount of process to list per page.

-D, --detail

Obtain detailed process descriptions instead of only their ID (default: False).

Default: False

-O, --order, --sort

Possible choices: created, process, id, version, identifier

Sorting field to list process. Name must be one of the fields supported by process objects.

Request Arguments

Parameters to control specific options related to HTTP request handling.

-rT, --request-timeout

Maximum timout duration (seconds) to wait for a response when performing HTTP requests (default: 5s).

Default: 5

-rR, --request-retries

Amount of attempt to retry HTTP requests in case of failure (default: no retry).

Service Authentication Arguments

Parameters to obtain access to a protected service using a request authentication handler.

-aC, --auth-class, --auth-handler

Script or module path reference to class implementation to handle inline request authentication. Format [path/to/script.py:module.AuthHandlerClass] or [installed.module.AuthHandlerClass] is expected.

Utility definitions are available as:

weaver.cli.BasicAuthHandler weaver.cli.BearerAuthHandler weaver.cli.CookieAuthHandler

Custom implementations are allowed for more advanced use cases.

-aI, --auth-identity, --auth-username

Authentication identity (or username) to be passed down to the specified Authentication Handler.

-aP, --auth-password

Authentication password to be passed down to the specified Authentication Handler.

-aU, --auth-url

Authentication URL to be passed down to the specified Authentication Handler.

-aM, --auth-method

Possible choices: GET, HEAD, POST, PUT, DELETE

Authentication HTTP request method to be passed down to the specified Authentication Handler (default: GET, case-insensitive).

Default: GET

-aH, --auth-header

Additional headers to apply for sending requests when using the authentication handler. This option can be provided multiple times, each with a value formatted as:

‘Header-Name: value’

Header names are case-insensitive. Quotes can be used in the <value> portion to delimit it. Surrounding spaces are trimmed.

Remote Provider Arguments

Parameters related to remote providers reporting.

-nP, --no-providers

Omit “providers” listing from returned result body (default).

Default: False

-wP, --with-providers

Include “providers” listing in returned result body along with local processes.

Default: False

describe

Obtain an existing process description.

weaver describe [--stdout] [--log LOG]
                [--quiet | --debug | --verbose | --log-level {DEBUG,ERROR,INFO,WARN}]
                [-h] -u URL [-nL | -wL] [-nH | -wH] [-H HEADER]
                [-F {JSON,JSON+RAW,JSON+STR,TEXT,TXT,XML,XML+RAW,XML+STR,YAML,YML}]
                [-rT REQUEST_TIMEOUT] [-rR REQUEST_RETRIES]
                [-aC AUTH_HANDLER_CLASS] [-aI IDENTITY] [-aP PASSWORD]
                [-aU AUTH_URL] [-aM HTTP_METHOD] [-aH HEADER] -p PROCESS_ID
                [-pI PROVIDER_ID] [-S {OLD,WPS,OGC}]
Logging Arguments

Options that configure output logging.

--stdout

Enforce logging to stdout for display in console.

Default: False

--log, --log-file

Output file to write generated logs.

--quiet, -q

Do not output anything else than error.

Default: False

--debug, -d

Enable extra debug logging.

Default: False

--verbose, -v

Output informative logging details.

Default: False

--log-level, -l

Possible choices: DEBUG, ERROR, INFO, WARN

Explicit log level to employ (default: None, case-insensitive).

Required Arguments
-u, --url

URL of the instance to run operations.

-p, --id, --process

Identifier of the process to run describe operation.

Optional Arguments
-nL, --no-links

Remove “links” section from returned result body.

Default: True

-wL, --with-links

Preserve “links” section from returned result body (default).

Default: True

-nH, --no-headers

Omit response headers, only returning the result body (default).

Default: False

-wH, --with-headers

Return response headers additionally to the result body.

Default: False

-H, --header

Additional headers to apply for sending requests toward the service. This option can be provided multiple times, each with a value formatted as:

‘Header-Name: value’

Header names are case-insensitive. Quotes can be used in the <value> portion to delimit it. Surrounding spaces are trimmed. Note that overridden headers expected by requests and the service could break some functionalities.

-F, --format

Possible choices: JSON, JSON+RAW, JSON+STR, TEXT, TXT, XML, XML+RAW, XML+STR, YAML, YML

Select an alternative output representation (default: JSON+STR, case-insensitive).

JSON: Representation as JSON (object), which can still be manipulated in code.

JSON+RAW: Representation as JSON content formatted as raw string without any indentation or newlines.

JSON+STR: Representation as JSON content formatted as string with indentation and newlines.

TEXT: Representation as plain text content without any specific reformatting or validation.

TXT: Representation as plain text content without any specific reformatting or validation.

XML: Representation as XML content formatted as serialized string.

XML+RAW: Representation as XML content formatted as raw string without indentation or newlines.

XML+STR: Representation as XML content formatted as string with indentation and newlines.

YAML: Representation as YAML content formatted as string with indentation and newlines.

YML: Alias to YAML.

-pI, --provider

Identifier of a remote provider under which the referred process can be found to run describe operation.

-S, --schema

Possible choices: OLD, WPS, OGC

Representation schema of the returned process description (default: OGC, case-insensitive).

Default: OGC

Request Arguments

Parameters to control specific options related to HTTP request handling.

-rT, --request-timeout

Maximum timout duration (seconds) to wait for a response when performing HTTP requests (default: 5s).

Default: 5

-rR, --request-retries

Amount of attempt to retry HTTP requests in case of failure (default: no retry).

Service Authentication Arguments

Parameters to obtain access to a protected service using a request authentication handler.

-aC, --auth-class, --auth-handler

Script or module path reference to class implementation to handle inline request authentication. Format [path/to/script.py:module.AuthHandlerClass] or [installed.module.AuthHandlerClass] is expected.

Utility definitions are available as:

weaver.cli.BasicAuthHandler weaver.cli.BearerAuthHandler weaver.cli.CookieAuthHandler

Custom implementations are allowed for more advanced use cases.

-aI, --auth-identity, --auth-username

Authentication identity (or username) to be passed down to the specified Authentication Handler.

-aP, --auth-password

Authentication password to be passed down to the specified Authentication Handler.

-aU, --auth-url

Authentication URL to be passed down to the specified Authentication Handler.

-aM, --auth-method

Possible choices: GET, HEAD, POST, PUT, DELETE

Authentication HTTP request method to be passed down to the specified Authentication Handler (default: GET, case-insensitive).

Default: GET

-aH, --auth-header

Additional headers to apply for sending requests when using the authentication handler. This option can be provided multiple times, each with a value formatted as:

‘Header-Name: value’

Header names are case-insensitive. Quotes can be used in the <value> portion to delimit it. Surrounding spaces are trimmed.

package

Obtain the Application Package definition of an existing process.

weaver package [--stdout] [--log LOG]
               [--quiet | --debug | --verbose | --log-level {DEBUG,ERROR,INFO,WARN}]
               [-h] -u URL [-nL | -wL] [-nH | -wH] [-H HEADER]
               [-F {JSON,JSON+RAW,JSON+STR,TEXT,TXT,XML,XML+RAW,XML+STR,YAML,YML}]
               [-rT REQUEST_TIMEOUT] [-rR REQUEST_RETRIES]
               [-aC AUTH_HANDLER_CLASS] [-aI IDENTITY] [-aP PASSWORD]
               [-aU AUTH_URL] [-aM HTTP_METHOD] [-aH HEADER] -p PROCESS_ID
               [-pI PROVIDER_ID]
Logging Arguments

Options that configure output logging.

--stdout

Enforce logging to stdout for display in console.

Default: False

--log, --log-file

Output file to write generated logs.

--quiet, -q

Do not output anything else than error.

Default: False

--debug, -d

Enable extra debug logging.

Default: False

--verbose, -v

Output informative logging details.

Default: False

--log-level, -l

Possible choices: DEBUG, ERROR, INFO, WARN

Explicit log level to employ (default: None, case-insensitive).

Required Arguments
-u, --url

URL of the instance to run operations.

-p, --id, --process

Identifier of the process to run package operation.

Optional Arguments
-nL, --no-links

Remove “links” section from returned result body.

Default: True

-wL, --with-links

Preserve “links” section from returned result body (default).

Default: True

-nH, --no-headers

Omit response headers, only returning the result body (default).

Default: False

-wH, --with-headers

Return response headers additionally to the result body.

Default: False

-H, --header

Additional headers to apply for sending requests toward the service. This option can be provided multiple times, each with a value formatted as:

‘Header-Name: value’

Header names are case-insensitive. Quotes can be used in the <value> portion to delimit it. Surrounding spaces are trimmed. Note that overridden headers expected by requests and the service could break some functionalities.

-F, --format

Possible choices: JSON, JSON+RAW, JSON+STR, TEXT, TXT, XML, XML+RAW, XML+STR, YAML, YML

Select an alternative output representation (default: JSON+STR, case-insensitive).

JSON: Representation as JSON (object), which can still be manipulated in code.

JSON+RAW: Representation as JSON content formatted as raw string without any indentation or newlines.

JSON+STR: Representation as JSON content formatted as string with indentation and newlines.

TEXT: Representation as plain text content without any specific reformatting or validation.

TXT: Representation as plain text content without any specific reformatting or validation.

XML: Representation as XML content formatted as serialized string.

XML+RAW: Representation as XML content formatted as raw string without indentation or newlines.

XML+STR: Representation as XML content formatted as string with indentation and newlines.

YAML: Representation as YAML content formatted as string with indentation and newlines.

YML: Alias to YAML.

-pI, --provider

Identifier of a remote provider under which the referred process can be found to run package operation.

Request Arguments

Parameters to control specific options related to HTTP request handling.

-rT, --request-timeout

Maximum timout duration (seconds) to wait for a response when performing HTTP requests (default: 5s).

Default: 5

-rR, --request-retries

Amount of attempt to retry HTTP requests in case of failure (default: no retry).

Service Authentication Arguments

Parameters to obtain access to a protected service using a request authentication handler.

-aC, --auth-class, --auth-handler

Script or module path reference to class implementation to handle inline request authentication. Format [path/to/script.py:module.AuthHandlerClass] or [installed.module.AuthHandlerClass] is expected.

Utility definitions are available as:

weaver.cli.BasicAuthHandler weaver.cli.BearerAuthHandler weaver.cli.CookieAuthHandler

Custom implementations are allowed for more advanced use cases.

-aI, --auth-identity, --auth-username

Authentication identity (or username) to be passed down to the specified Authentication Handler.

-aP, --auth-password

Authentication password to be passed down to the specified Authentication Handler.

-aU, --auth-url

Authentication URL to be passed down to the specified Authentication Handler.

-aM, --auth-method

Possible choices: GET, HEAD, POST, PUT, DELETE

Authentication HTTP request method to be passed down to the specified Authentication Handler (default: GET, case-insensitive).

Default: GET

-aH, --auth-header

Additional headers to apply for sending requests when using the authentication handler. This option can be provided multiple times, each with a value formatted as:

‘Header-Name: value’

Header names are case-insensitive. Quotes can be used in the <value> portion to delimit it. Surrounding spaces are trimmed.

execute

Submit a job execution for an existing process.

weaver execute [--stdout] [--log LOG]
               [--quiet | --debug | --verbose | --log-level {DEBUG,ERROR,INFO,WARN}]
               [-h] -u URL [-nL | -wL] [-nH | -wH] [-H HEADER]
               [-F {JSON,JSON+RAW,JSON+STR,TEXT,TXT,XML,XML+RAW,XML+STR,YAML,YML}]
               [-rT REQUEST_TIMEOUT] [-rR REQUEST_RETRIES]
               [-aC AUTH_HANDLER_CLASS] [-aI IDENTITY] [-aP PASSWORD]
               [-aU AUTH_URL] [-aM HTTP_METHOD] [-aH HEADER] -p PROCESS_ID
               [-pI PROVIDER_ID] -I INPUTS [-R REFERENCE]
               [-oP | -oC OUTPUT_CONTEXT] [-M] [-T TIMEOUT] [-W INTERVAL]
               [-sEP EMAIL] [-sEF EMAIL] [-sES EMAIL] [-sCP URL] [-sCF URL]
               [-sCS URL]
Logging Arguments

Options that configure output logging.

--stdout

Enforce logging to stdout for display in console.

Default: False

--log, --log-file

Output file to write generated logs.

--quiet, -q

Do not output anything else than error.

Default: False

--debug, -d

Enable extra debug logging.

Default: False

--verbose, -v

Output informative logging details.

Default: False

--log-level, -l

Possible choices: DEBUG, ERROR, INFO, WARN

Explicit log level to employ (default: None, case-insensitive).

Required Arguments
-u, --url

URL of the instance to run operations.

-p, --id, --process

Identifier of the process to run execute operation.

-I, --inputs

Literal input definitions, or a file path or URL reference to JSON or YAML contents defining job inputs with OGC-API or CWL schema. This parameter is required.

To provide inputs using a file reference, refer to relevant CWL Job schema or API request schema for selected format. Both mapping and listing formats are supported.

To execute a process without any inputs (e.g.: using its defaults), supply an explicit empty input (i.e.: -I "" or loaded from JSON/YAML file as {}).

To provide inputs using literal command-line definitions, inputs should be specified using <id>=<value> convention, with distinct -I options for each applicable input value.

Values that require other type than string to be converted for job submission can include the data type following the ID using a colon separator (i.e.: <id>:<type>=<value>). For example, an integer could be specified as follows: number:int=1 while a floating point number would be: number:float=1.23.

File references (href) should be specified using File as the type (i.e.: input:File=http://...). Note that File in this case is expected to be an URL location where the file can be downloaded from. When a local file is supplied, Weaver will automatically convert it to a remote Vault File in order to upload it at the specified URL location and make it available for the remote process.

Inputs with multiplicity (maxOccurs > 1) can be specified using semicolon (;) separated values after a single input ID. Note that this is not the same as a single-value array-like input, which should use comma (,) separated values instead. The type of an element-wise item of this input can also be provided (i.e.: multiInput:int=1;2;3). Alternatively, the same input ID can be repeated over many -I options each providing an element of the multi-value input to be formed (i.e.: -I multiInput=1 -I multiInput=2 -I multiInput=3).

Additional parameters can be specified following any <value> using any amount of @<param>=<info> specifiers. Those will be added to the inputs body submitted for execution. This can be used, amongst other things, to provide a file’s mediaType or encoding details. When using multi-value inputs, each item value can take @ parameters independently with distinct properties.

Any value that contains special separator characters (:;@) to be used as literal entries must be URL-encoded (%XX) to avoid invalid parsing.

Example: -I message='Hello Weaver' -I value:int=1234 -I file:File=data.xml@mediaType=text/xml

Optional Arguments
-nL, --no-links

Remove “links” section from returned result body.

Default: True

-wL, --with-links

Preserve “links” section from returned result body (default).

Default: True

-nH, --no-headers

Omit response headers, only returning the result body (default).

Default: False

-wH, --with-headers

Return response headers additionally to the result body.

Default: False

-H, --header

Additional headers to apply for sending requests toward the service. This option can be provided multiple times, each with a value formatted as:

‘Header-Name: value’

Header names are case-insensitive. Quotes can be used in the <value> portion to delimit it. Surrounding spaces are trimmed. Note that overridden headers expected by requests and the service could break some functionalities.

-F, --format

Possible choices: JSON, JSON+RAW, JSON+STR, TEXT, TXT, XML, XML+RAW, XML+STR, YAML, YML

Select an alternative output representation (default: JSON+STR, case-insensitive).

JSON: Representation as JSON (object), which can still be manipulated in code.

JSON+RAW: Representation as JSON content formatted as raw string without any indentation or newlines.

JSON+STR: Representation as JSON content formatted as string with indentation and newlines.

TEXT: Representation as plain text content without any specific reformatting or validation.

TXT: Representation as plain text content without any specific reformatting or validation.

XML: Representation as XML content formatted as serialized string.

XML+RAW: Representation as XML content formatted as raw string without indentation or newlines.

XML+STR: Representation as XML content formatted as string with indentation and newlines.

YAML: Representation as YAML content formatted as string with indentation and newlines.

YML: Alias to YAML.

-pI, --provider

Identifier of a remote provider under which the referred process can be found to run execute operation.

-R, --ref, --reference

Indicates which outputs by ID to be returned as HTTP Link header reference instead of body content value. This defines the output transmission mode when submitting the execution request.

With reference transmission mode, outputs that contain literal data will be linked by text/plain file containing the data. Outputs that refer to a file reference will simply contain that URL reference as link.

With value transmission mode (default behavior when outputs are not specified in this list), outputs are returned as direct values (literal or href) within the response content body.

When requesting any output to be returned by reference, option -H/--headers should be considered as well to return the provided Link headers for these outputs on the command line.

Example: -R output-one -R output-two

-oP, --output-public

Set header ‘X-WPS-Output-Context: public’ to indicate preference of job output context to be located under the public WPS output location of the server. The server is not mandated to fulfill this preference, but will apply it if supported and considered a valid value.

-oC, --output-context

Set header ‘X-WPS-Output-Context’ with the specified value to indicate preference of job output context located under the requested WPS output location of the server. The server is not mandated to fulfill this preference, but will apply it if supported and considered a valid value.

-M, --monitor

Automatically perform the monitoring operation following job submission to retrieve final results. If not requested, the created job status location is directly returned.

Default: False

-T, --timeout, --exec-timeout

Wait timeout (seconds) of the maximum monitoring duration of the job execution (default: 60s). If this timeout is reached but job is still running, another call directly to the monitoring operation can be done to resume monitoring. The job execution itself will not stop in case of timeout.

Default: 60

-W, --wait, --interval

Wait interval (seconds) between each job status polling during monitoring (default: 5s).

Default: 5

Request Arguments

Parameters to control specific options related to HTTP request handling.

-rT, --request-timeout

Maximum timout duration (seconds) to wait for a response when performing HTTP requests (default: 5s).

Default: 5

-rR, --request-retries

Amount of attempt to retry HTTP requests in case of failure (default: no retry).

Service Authentication Arguments

Parameters to obtain access to a protected service using a request authentication handler.

-aC, --auth-class, --auth-handler

Script or module path reference to class implementation to handle inline request authentication. Format [path/to/script.py:module.AuthHandlerClass] or [installed.module.AuthHandlerClass] is expected.

Utility definitions are available as:

weaver.cli.BasicAuthHandler weaver.cli.BearerAuthHandler weaver.cli.CookieAuthHandler

Custom implementations are allowed for more advanced use cases.

-aI, --auth-identity, --auth-username

Authentication identity (or username) to be passed down to the specified Authentication Handler.

-aP, --auth-password

Authentication password to be passed down to the specified Authentication Handler.

-aU, --auth-url

Authentication URL to be passed down to the specified Authentication Handler.

-aM, --auth-method

Possible choices: GET, HEAD, POST, PUT, DELETE

Authentication HTTP request method to be passed down to the specified Authentication Handler (default: GET, case-insensitive).

Default: GET

-aH, --auth-header

Additional headers to apply for sending requests when using the authentication handler. This option can be provided multiple times, each with a value formatted as:

‘Header-Name: value’

Header names are case-insensitive. Quotes can be used in the <value> portion to delimit it. Surrounding spaces are trimmed.

Notification Subscribers

Email or callback request URL to obtain notification of job status milestones.

Note that for email notifications, the targeted server must have properly configured SMTP settings.

-sEP, --subscriber-email-progress

Send a notification email to this address once the job started execution.

-sEF, --subscriber-email-failed

Send a notification email to this address if the job execution completed with failure.

-sES, --subscriber-email-success

Send a notification email to this address if the job execution completed successfully.

-sCP, --subscriber-callback-progress

Send an HTTP callback request to this URL once the job started execution.

The request body will contain the JSON representation of the job status details.

-sCF, --subscriber-callback-failed

Send an HTTP callback request to this URL if the job execution completed with failure.

The request body will contain the JSON representation of the job status details.

-sCS, --subscriber-callback-success

Send an HTTP callback request to this URL if the job execution completed successfully.

The request body will contain the JSON representation of the job results.

jobs

Obtain listing of registered jobs.

weaver jobs [--stdout] [--log LOG]
            [--quiet | --debug | --verbose | --log-level {DEBUG,ERROR,INFO,WARN}]
            [-h] -u URL [-nL | -wL] [-nH | -wH] [-H HEADER]
            [-F {JSON,JSON+RAW,JSON+STR,TEXT,TXT,XML,XML+RAW,XML+STR,YAML,YML}]
            [-rT REQUEST_TIMEOUT] [-rR REQUEST_RETRIES]
            [-aC AUTH_HANDLER_CLASS] [-aI IDENTITY] [-aP PASSWORD]
            [-aU AUTH_URL] [-aM HTTP_METHOD] [-aH HEADER] [-P PAGE] [-N LIMIT]
            [-D] [-O {created,finished,status,process,user,service}]
            [-S {successful,dismissed,accepted,paused,failed,running,unknown,succeeded,started,exception} [{successful,dismissed,accepted,paused,failed,running,unknown,succeeded,started,exception} ...]]
            [-G] [-fP PROCESS] [-fS PROVIDER] [-fT TAGS [TAGS ...]]
Logging Arguments

Options that configure output logging.

--stdout

Enforce logging to stdout for display in console.

Default: False

--log, --log-file

Output file to write generated logs.

--quiet, -q

Do not output anything else than error.

Default: False

--debug, -d

Enable extra debug logging.

Default: False

--verbose, -v

Output informative logging details.

Default: False

--log-level, -l

Possible choices: DEBUG, ERROR, INFO, WARN

Explicit log level to employ (default: None, case-insensitive).

Required Arguments
-u, --url

URL of the instance to run operations.

Optional Arguments
-nL, --no-links

Remove “links” section from returned result body.

Default: True

-wL, --with-links

Preserve “links” section from returned result body (default).

Default: True

-nH, --no-headers

Omit response headers, only returning the result body (default).

Default: False

-wH, --with-headers

Return response headers additionally to the result body.

Default: False

-H, --header

Additional headers to apply for sending requests toward the service. This option can be provided multiple times, each with a value formatted as:

‘Header-Name: value’

Header names are case-insensitive. Quotes can be used in the <value> portion to delimit it. Surrounding spaces are trimmed. Note that overridden headers expected by requests and the service could break some functionalities.

-F, --format

Possible choices: JSON, JSON+RAW, JSON+STR, TEXT, TXT, XML, XML+RAW, XML+STR, YAML, YML

Select an alternative output representation (default: JSON+STR, case-insensitive).

JSON: Representation as JSON (object), which can still be manipulated in code.

JSON+RAW: Representation as JSON content formatted as raw string without any indentation or newlines.

JSON+STR: Representation as JSON content formatted as string with indentation and newlines.

TEXT: Representation as plain text content without any specific reformatting or validation.

TXT: Representation as plain text content without any specific reformatting or validation.

XML: Representation as XML content formatted as serialized string.

XML+RAW: Representation as XML content formatted as raw string without indentation or newlines.

XML+STR: Representation as XML content formatted as string with indentation and newlines.

YAML: Representation as YAML content formatted as string with indentation and newlines.

YML: Alias to YAML.

-P, --page

Specify the paging index for job listing.

-N, --number, --limit

Specify the amount of job to list per page.

-D, --detail

Obtain detailed job descriptions instead of only their ID (default: False).

Default: False

-O, --order, --sort

Possible choices: created, finished, status, process, user, service

Sorting field to list job. Name must be one of the fields supported by job objects.

-S, --status

Possible choices: successful, dismissed, accepted, paused, failed, running, unknown, succeeded, started, exception

Filter job listing only to matching status. If multiple are provided, must match one of them.

-G, --groups

Obtain grouped representation of jobs per provider and process categories.

Default: False

-fP, --process

Filter job listing only to matching process (local and/or remote whether combined with ‘-fS’).

-fS, --provider, --service

Filter job listing only to matching remote service provider.

-fT, --tags

Filter job listing only to matching tags. Jobs must match all tags simultaneously, not one of them.

Request Arguments

Parameters to control specific options related to HTTP request handling.

-rT, --request-timeout

Maximum timout duration (seconds) to wait for a response when performing HTTP requests (default: 5s).

Default: 5

-rR, --request-retries

Amount of attempt to retry HTTP requests in case of failure (default: no retry).

Service Authentication Arguments

Parameters to obtain access to a protected service using a request authentication handler.

-aC, --auth-class, --auth-handler

Script or module path reference to class implementation to handle inline request authentication. Format [path/to/script.py:module.AuthHandlerClass] or [installed.module.AuthHandlerClass] is expected.

Utility definitions are available as:

weaver.cli.BasicAuthHandler weaver.cli.BearerAuthHandler weaver.cli.CookieAuthHandler

Custom implementations are allowed for more advanced use cases.

-aI, --auth-identity, --auth-username

Authentication identity (or username) to be passed down to the specified Authentication Handler.

-aP, --auth-password

Authentication password to be passed down to the specified Authentication Handler.

-aU, --auth-url

Authentication URL to be passed down to the specified Authentication Handler.

-aM, --auth-method

Possible choices: GET, HEAD, POST, PUT, DELETE

Authentication HTTP request method to be passed down to the specified Authentication Handler (default: GET, case-insensitive).

Default: GET

-aH, --auth-header

Additional headers to apply for sending requests when using the authentication handler. This option can be provided multiple times, each with a value formatted as:

‘Header-Name: value’

Header names are case-insensitive. Quotes can be used in the <value> portion to delimit it. Surrounding spaces are trimmed.

monitor

Monitor a pending or running job execution until completion or up to a maximum wait time.

weaver monitor [--stdout] [--log LOG]
               [--quiet | --debug | --verbose | --log-level {DEBUG,ERROR,INFO,WARN}]
               [-h] [-u URL] -j JOB_REFERENCE [-T TIMEOUT] [-W INTERVAL]
               [-nL | -wL] [-nH | -wH] [-H HEADER]
               [-F {JSON,JSON+RAW,JSON+STR,TEXT,TXT,XML,XML+RAW,XML+STR,YAML,YML}]
               [-rT REQUEST_TIMEOUT] [-rR REQUEST_RETRIES]
               [-aC AUTH_HANDLER_CLASS] [-aI IDENTITY] [-aP PASSWORD]
               [-aU AUTH_URL] [-aM HTTP_METHOD] [-aH HEADER]
Required Arguments
-j, --job

Job URL or UUID to run monitor operation. If full Job URL is provided, the instance --url parameter can be omitted.

Optional Arguments
-u, --url

URL of the instance to run operations.

-T, --timeout, --exec-timeout

Wait timeout (seconds) of the maximum monitoring duration of the job execution (default: 60s). If this timeout is reached but job is still running, another call directly to the monitoring operation can be done to resume monitoring. The job execution itself will not stop in case of timeout.

Default: 60

-W, --wait, --interval

Wait interval (seconds) between each job status polling during monitoring (default: 5s).

Default: 5

-nL, --no-links

Remove “links” section from returned result body.

Default: True

-wL, --with-links

Preserve “links” section from returned result body (default).

Default: True

-nH, --no-headers

Omit response headers, only returning the result body (default).

Default: False

-wH, --with-headers

Return response headers additionally to the result body.

Default: False

-H, --header

Additional headers to apply for sending requests toward the service. This option can be provided multiple times, each with a value formatted as:

‘Header-Name: value’

Header names are case-insensitive. Quotes can be used in the <value> portion to delimit it. Surrounding spaces are trimmed. Note that overridden headers expected by requests and the service could break some functionalities.

-F, --format

Possible choices: JSON, JSON+RAW, JSON+STR, TEXT, TXT, XML, XML+RAW, XML+STR, YAML, YML

Select an alternative output representation (default: JSON+STR, case-insensitive).

JSON: Representation as JSON (object), which can still be manipulated in code.

JSON+RAW: Representation as JSON content formatted as raw string without any indentation or newlines.

JSON+STR: Representation as JSON content formatted as string with indentation and newlines.

TEXT: Representation as plain text content without any specific reformatting or validation.

TXT: Representation as plain text content without any specific reformatting or validation.

XML: Representation as XML content formatted as serialized string.

XML+RAW: Representation as XML content formatted as raw string without indentation or newlines.

XML+STR: Representation as XML content formatted as string with indentation and newlines.

YAML: Representation as YAML content formatted as string with indentation and newlines.

YML: Alias to YAML.

Logging Arguments

Options that configure output logging.

--stdout

Enforce logging to stdout for display in console.

Default: False

--log, --log-file

Output file to write generated logs.

--quiet, -q

Do not output anything else than error.

Default: False

--debug, -d

Enable extra debug logging.

Default: False

--verbose, -v

Output informative logging details.

Default: False

--log-level, -l

Possible choices: DEBUG, ERROR, INFO, WARN

Explicit log level to employ (default: None, case-insensitive).

Request Arguments

Parameters to control specific options related to HTTP request handling.

-rT, --request-timeout

Maximum timout duration (seconds) to wait for a response when performing HTTP requests (default: 5s).

Default: 5

-rR, --request-retries

Amount of attempt to retry HTTP requests in case of failure (default: no retry).

Service Authentication Arguments

Parameters to obtain access to a protected service using a request authentication handler.

-aC, --auth-class, --auth-handler

Script or module path reference to class implementation to handle inline request authentication. Format [path/to/script.py:module.AuthHandlerClass] or [installed.module.AuthHandlerClass] is expected.

Utility definitions are available as:

weaver.cli.BasicAuthHandler weaver.cli.BearerAuthHandler weaver.cli.CookieAuthHandler

Custom implementations are allowed for more advanced use cases.

-aI, --auth-identity, --auth-username

Authentication identity (or username) to be passed down to the specified Authentication Handler.

-aP, --auth-password

Authentication password to be passed down to the specified Authentication Handler.

-aU, --auth-url

Authentication URL to be passed down to the specified Authentication Handler.

-aM, --auth-method

Possible choices: GET, HEAD, POST, PUT, DELETE

Authentication HTTP request method to be passed down to the specified Authentication Handler (default: GET, case-insensitive).

Default: GET

-aH, --auth-header

Additional headers to apply for sending requests when using the authentication handler. This option can be provided multiple times, each with a value formatted as:

‘Header-Name: value’

Header names are case-insensitive. Quotes can be used in the <value> portion to delimit it. Surrounding spaces are trimmed.

dismiss

Dismiss a pending or running job, or wipe any finished job results.

weaver dismiss [--stdout] [--log LOG]
               [--quiet | --debug | --verbose | --log-level {DEBUG,ERROR,INFO,WARN}]
               [-h] [-u URL] -j JOB_REFERENCE [-nL | -wL] [-nH | -wH]
               [-H HEADER]
               [-F {JSON,JSON+RAW,JSON+STR,TEXT,TXT,XML,XML+RAW,XML+STR,YAML,YML}]
               [-rT REQUEST_TIMEOUT] [-rR REQUEST_RETRIES]
               [-aC AUTH_HANDLER_CLASS] [-aI IDENTITY] [-aP PASSWORD]
               [-aU AUTH_URL] [-aM HTTP_METHOD] [-aH HEADER]
Logging Arguments

Options that configure output logging.

--stdout

Enforce logging to stdout for display in console.

Default: False

--log, --log-file

Output file to write generated logs.

--quiet, -q

Do not output anything else than error.

Default: False

--debug, -d

Enable extra debug logging.

Default: False

--verbose, -v

Output informative logging details.

Default: False

--log-level, -l

Possible choices: DEBUG, ERROR, INFO, WARN

Explicit log level to employ (default: None, case-insensitive).

Required Arguments
-j, --job

Job URL or UUID to run dismiss operation. If full Job URL is provided, the instance --url parameter can be omitted.

Optional Arguments
-u, --url

URL of the instance to run operations.

-nL, --no-links

Remove “links” section from returned result body.

Default: True

-wL, --with-links

Preserve “links” section from returned result body (default).

Default: True

-nH, --no-headers

Omit response headers, only returning the result body (default).

Default: False

-wH, --with-headers

Return response headers additionally to the result body.

Default: False

-H, --header

Additional headers to apply for sending requests toward the service. This option can be provided multiple times, each with a value formatted as:

‘Header-Name: value’

Header names are case-insensitive. Quotes can be used in the <value> portion to delimit it. Surrounding spaces are trimmed. Note that overridden headers expected by requests and the service could break some functionalities.

-F, --format

Possible choices: JSON, JSON+RAW, JSON+STR, TEXT, TXT, XML, XML+RAW, XML+STR, YAML, YML

Select an alternative output representation (default: JSON+STR, case-insensitive).

JSON: Representation as JSON (object), which can still be manipulated in code.

JSON+RAW: Representation as JSON content formatted as raw string without any indentation or newlines.

JSON+STR: Representation as JSON content formatted as string with indentation and newlines.

TEXT: Representation as plain text content without any specific reformatting or validation.

TXT: Representation as plain text content without any specific reformatting or validation.

XML: Representation as XML content formatted as serialized string.

XML+RAW: Representation as XML content formatted as raw string without indentation or newlines.

XML+STR: Representation as XML content formatted as string with indentation and newlines.

YAML: Representation as YAML content formatted as string with indentation and newlines.

YML: Alias to YAML.

Request Arguments

Parameters to control specific options related to HTTP request handling.

-rT, --request-timeout

Maximum timout duration (seconds) to wait for a response when performing HTTP requests (default: 5s).

Default: 5

-rR, --request-retries

Amount of attempt to retry HTTP requests in case of failure (default: no retry).

Service Authentication Arguments

Parameters to obtain access to a protected service using a request authentication handler.

-aC, --auth-class, --auth-handler

Script or module path reference to class implementation to handle inline request authentication. Format [path/to/script.py:module.AuthHandlerClass] or [installed.module.AuthHandlerClass] is expected.

Utility definitions are available as:

weaver.cli.BasicAuthHandler weaver.cli.BearerAuthHandler weaver.cli.CookieAuthHandler

Custom implementations are allowed for more advanced use cases.

-aI, --auth-identity, --auth-username

Authentication identity (or username) to be passed down to the specified Authentication Handler.

-aP, --auth-password

Authentication password to be passed down to the specified Authentication Handler.

-aU, --auth-url

Authentication URL to be passed down to the specified Authentication Handler.

-aM, --auth-method

Possible choices: GET, HEAD, POST, PUT, DELETE

Authentication HTTP request method to be passed down to the specified Authentication Handler (default: GET, case-insensitive).

Default: GET

-aH, --auth-header

Additional headers to apply for sending requests when using the authentication handler. This option can be provided multiple times, each with a value formatted as:

‘Header-Name: value’

Header names are case-insensitive. Quotes can be used in the <value> portion to delimit it. Surrounding spaces are trimmed.

status

Obtain the status of a job using a reference UUID or URL. This is equivalent to doing a single-shot ‘monitor’ operation without any pooling or retries.

weaver status [--stdout] [--log LOG]
              [--quiet | --debug | --verbose | --log-level {DEBUG,ERROR,INFO,WARN}]
              [-h] [-u URL] -j JOB_REFERENCE [-nL | -wL] [-nH | -wH]
              [-H HEADER]
              [-F {JSON,JSON+RAW,JSON+STR,TEXT,TXT,XML,XML+RAW,XML+STR,YAML,YML}]
              [-rT REQUEST_TIMEOUT] [-rR REQUEST_RETRIES]
              [-aC AUTH_HANDLER_CLASS] [-aI IDENTITY] [-aP PASSWORD]
              [-aU AUTH_URL] [-aM HTTP_METHOD] [-aH HEADER]
Logging Arguments

Options that configure output logging.

--stdout

Enforce logging to stdout for display in console.

Default: False

--log, --log-file

Output file to write generated logs.

--quiet, -q

Do not output anything else than error.

Default: False

--debug, -d

Enable extra debug logging.

Default: False

--verbose, -v

Output informative logging details.

Default: False

--log-level, -l

Possible choices: DEBUG, ERROR, INFO, WARN

Explicit log level to employ (default: None, case-insensitive).

Required Arguments
-j, --job

Job URL or UUID to run status operation. If full Job URL is provided, the instance --url parameter can be omitted.

Optional Arguments
-u, --url

URL of the instance to run operations.

-nL, --no-links

Remove “links” section from returned result body.

Default: True

-wL, --with-links

Preserve “links” section from returned result body (default).

Default: True

-nH, --no-headers

Omit response headers, only returning the result body (default).

Default: False

-wH, --with-headers

Return response headers additionally to the result body.

Default: False

-H, --header

Additional headers to apply for sending requests toward the service. This option can be provided multiple times, each with a value formatted as:

‘Header-Name: value’

Header names are case-insensitive. Quotes can be used in the <value> portion to delimit it. Surrounding spaces are trimmed. Note that overridden headers expected by requests and the service could break some functionalities.

-F, --format

Possible choices: JSON, JSON+RAW, JSON+STR, TEXT, TXT, XML, XML+RAW, XML+STR, YAML, YML

Select an alternative output representation (default: JSON+STR, case-insensitive).

JSON: Representation as JSON (object), which can still be manipulated in code.

JSON+RAW: Representation as JSON content formatted as raw string without any indentation or newlines.

JSON+STR: Representation as JSON content formatted as string with indentation and newlines.

TEXT: Representation as plain text content without any specific reformatting or validation.

TXT: Representation as plain text content without any specific reformatting or validation.

XML: Representation as XML content formatted as serialized string.

XML+RAW: Representation as XML content formatted as raw string without indentation or newlines.

XML+STR: Representation as XML content formatted as string with indentation and newlines.

YAML: Representation as YAML content formatted as string with indentation and newlines.

YML: Alias to YAML.

Request Arguments

Parameters to control specific options related to HTTP request handling.

-rT, --request-timeout

Maximum timout duration (seconds) to wait for a response when performing HTTP requests (default: 5s).

Default: 5

-rR, --request-retries

Amount of attempt to retry HTTP requests in case of failure (default: no retry).

Service Authentication Arguments

Parameters to obtain access to a protected service using a request authentication handler.

-aC, --auth-class, --auth-handler

Script or module path reference to class implementation to handle inline request authentication. Format [path/to/script.py:module.AuthHandlerClass] or [installed.module.AuthHandlerClass] is expected.

Utility definitions are available as:

weaver.cli.BasicAuthHandler weaver.cli.BearerAuthHandler weaver.cli.CookieAuthHandler

Custom implementations are allowed for more advanced use cases.

-aI, --auth-identity, --auth-username

Authentication identity (or username) to be passed down to the specified Authentication Handler.

-aP, --auth-password

Authentication password to be passed down to the specified Authentication Handler.

-aU, --auth-url

Authentication URL to be passed down to the specified Authentication Handler.

-aM, --auth-method

Possible choices: GET, HEAD, POST, PUT, DELETE

Authentication HTTP request method to be passed down to the specified Authentication Handler (default: GET, case-insensitive).

Default: GET

-aH, --auth-header

Additional headers to apply for sending requests when using the authentication handler. This option can be provided multiple times, each with a value formatted as:

‘Header-Name: value’

Header names are case-insensitive. Quotes can be used in the <value> portion to delimit it. Surrounding spaces are trimmed.

logs

Obtain the logs of a job using a reference UUID or URL. Only guaranteed by Weaver instances. Pure ‘OGC API - Processes’ servers might not implement this feature.

weaver logs [--stdout] [--log LOG]
            [--quiet | --debug | --verbose | --log-level {DEBUG,ERROR,INFO,WARN}]
            [-h] [-u URL] -j JOB_REFERENCE [-nL | -wL] [-nH | -wH] [-H HEADER]
            [-F {JSON,JSON+RAW,JSON+STR,TEXT,TXT,XML,XML+RAW,XML+STR,YAML,YML}]
            [-rT REQUEST_TIMEOUT] [-rR REQUEST_RETRIES]
            [-aC AUTH_HANDLER_CLASS] [-aI IDENTITY] [-aP PASSWORD]
            [-aU AUTH_URL] [-aM HTTP_METHOD] [-aH HEADER]
Logging Arguments

Options that configure output logging.

--stdout

Enforce logging to stdout for display in console.

Default: False

--log, --log-file

Output file to write generated logs.

--quiet, -q

Do not output anything else than error.

Default: False

--debug, -d

Enable extra debug logging.

Default: False

--verbose, -v

Output informative logging details.

Default: False

--log-level, -l

Possible choices: DEBUG, ERROR, INFO, WARN

Explicit log level to employ (default: None, case-insensitive).

Required Arguments
-j, --job

Job URL or UUID to run logs operation. If full Job URL is provided, the instance --url parameter can be omitted.

Optional Arguments
-u, --url

URL of the instance to run operations.

-nL, --no-links

Remove “links” section from returned result body.

Default: True

-wL, --with-links

Preserve “links” section from returned result body (default).

Default: True

-nH, --no-headers

Omit response headers, only returning the result body (default).

Default: False

-wH, --with-headers

Return response headers additionally to the result body.

Default: False

-H, --header

Additional headers to apply for sending requests toward the service. This option can be provided multiple times, each with a value formatted as:

‘Header-Name: value’

Header names are case-insensitive. Quotes can be used in the <value> portion to delimit it. Surrounding spaces are trimmed. Note that overridden headers expected by requests and the service could break some functionalities.

-F, --format

Possible choices: JSON, JSON+RAW, JSON+STR, TEXT, TXT, XML, XML+RAW, XML+STR, YAML, YML

Select an alternative output representation (default: JSON+STR, case-insensitive).

JSON: Representation as JSON (object), which can still be manipulated in code.

JSON+RAW: Representation as JSON content formatted as raw string without any indentation or newlines.

JSON+STR: Representation as JSON content formatted as string with indentation and newlines.

TEXT: Representation as plain text content without any specific reformatting or validation.

TXT: Representation as plain text content without any specific reformatting or validation.

XML: Representation as XML content formatted as serialized string.

XML+RAW: Representation as XML content formatted as raw string without indentation or newlines.

XML+STR: Representation as XML content formatted as string with indentation and newlines.

YAML: Representation as YAML content formatted as string with indentation and newlines.

YML: Alias to YAML.

Request Arguments

Parameters to control specific options related to HTTP request handling.

-rT, --request-timeout

Maximum timout duration (seconds) to wait for a response when performing HTTP requests (default: 5s).

Default: 5

-rR, --request-retries

Amount of attempt to retry HTTP requests in case of failure (default: no retry).

Service Authentication Arguments

Parameters to obtain access to a protected service using a request authentication handler.

-aC, --auth-class, --auth-handler

Script or module path reference to class implementation to handle inline request authentication. Format [path/to/script.py:module.AuthHandlerClass] or [installed.module.AuthHandlerClass] is expected.

Utility definitions are available as:

weaver.cli.BasicAuthHandler weaver.cli.BearerAuthHandler weaver.cli.CookieAuthHandler

Custom implementations are allowed for more advanced use cases.

-aI, --auth-identity, --auth-username

Authentication identity (or username) to be passed down to the specified Authentication Handler.

-aP, --auth-password

Authentication password to be passed down to the specified Authentication Handler.

-aU, --auth-url

Authentication URL to be passed down to the specified Authentication Handler.

-aM, --auth-method

Possible choices: GET, HEAD, POST, PUT, DELETE

Authentication HTTP request method to be passed down to the specified Authentication Handler (default: GET, case-insensitive).

Default: GET

-aH, --auth-header

Additional headers to apply for sending requests when using the authentication handler. This option can be provided multiple times, each with a value formatted as:

‘Header-Name: value’

Header names are case-insensitive. Quotes can be used in the <value> portion to delimit it. Surrounding spaces are trimmed.

exceptions (errors)

Obtain the exceptions and error details of a failed job using a reference UUID or URL. If the job is not marked with failed status, this will return an error. Only guaranteed by Weaver instances. Pure ‘OGC API - Processes’ servers might not implement this feature.

weaver exceptions [--stdout] [--log LOG]
                  [--quiet | --debug | --verbose | --log-level {DEBUG,ERROR,INFO,WARN}]
                  [-h] [-u URL] -j JOB_REFERENCE [-nL | -wL] [-nH | -wH]
                  [-H HEADER]
                  [-F {JSON,JSON+RAW,JSON+STR,TEXT,TXT,XML,XML+RAW,XML+STR,YAML,YML}]
                  [-rT REQUEST_TIMEOUT] [-rR REQUEST_RETRIES]
                  [-aC AUTH_HANDLER_CLASS] [-aI IDENTITY] [-aP PASSWORD]
                  [-aU AUTH_URL] [-aM HTTP_METHOD] [-aH HEADER]
Logging Arguments

Options that configure output logging.

--stdout

Enforce logging to stdout for display in console.

Default: False

--log, --log-file

Output file to write generated logs.

--quiet, -q

Do not output anything else than error.

Default: False

--debug, -d

Enable extra debug logging.

Default: False

--verbose, -v

Output informative logging details.

Default: False

--log-level, -l

Possible choices: DEBUG, ERROR, INFO, WARN

Explicit log level to employ (default: None, case-insensitive).

Required Arguments
-j, --job

Job URL or UUID to run exceptions operation. If full Job URL is provided, the instance --url parameter can be omitted.

Optional Arguments
-u, --url

URL of the instance to run operations.

-nL, --no-links

Remove “links” section from returned result body.

Default: True

-wL, --with-links

Preserve “links” section from returned result body (default).

Default: True

-nH, --no-headers

Omit response headers, only returning the result body (default).

Default: False

-wH, --with-headers

Return response headers additionally to the result body.

Default: False

-H, --header

Additional headers to apply for sending requests toward the service. This option can be provided multiple times, each with a value formatted as:

‘Header-Name: value’

Header names are case-insensitive. Quotes can be used in the <value> portion to delimit it. Surrounding spaces are trimmed. Note that overridden headers expected by requests and the service could break some functionalities.

-F, --format

Possible choices: JSON, JSON+RAW, JSON+STR, TEXT, TXT, XML, XML+RAW, XML+STR, YAML, YML

Select an alternative output representation (default: JSON+STR, case-insensitive).

JSON: Representation as JSON (object), which can still be manipulated in code.

JSON+RAW: Representation as JSON content formatted as raw string without any indentation or newlines.

JSON+STR: Representation as JSON content formatted as string with indentation and newlines.

TEXT: Representation as plain text content without any specific reformatting or validation.

TXT: Representation as plain text content without any specific reformatting or validation.

XML: Representation as XML content formatted as serialized string.

XML+RAW: Representation as XML content formatted as raw string without indentation or newlines.

XML+STR: Representation as XML content formatted as string with indentation and newlines.

YAML: Representation as YAML content formatted as string with indentation and newlines.

YML: Alias to YAML.

Request Arguments

Parameters to control specific options related to HTTP request handling.

-rT, --request-timeout

Maximum timout duration (seconds) to wait for a response when performing HTTP requests (default: 5s).

Default: 5

-rR, --request-retries

Amount of attempt to retry HTTP requests in case of failure (default: no retry).

Service Authentication Arguments

Parameters to obtain access to a protected service using a request authentication handler.

-aC, --auth-class, --auth-handler

Script or module path reference to class implementation to handle inline request authentication. Format [path/to/script.py:module.AuthHandlerClass] or [installed.module.AuthHandlerClass] is expected.

Utility definitions are available as:

weaver.cli.BasicAuthHandler weaver.cli.BearerAuthHandler weaver.cli.CookieAuthHandler

Custom implementations are allowed for more advanced use cases.

-aI, --auth-identity, --auth-username

Authentication identity (or username) to be passed down to the specified Authentication Handler.

-aP, --auth-password

Authentication password to be passed down to the specified Authentication Handler.

-aU, --auth-url

Authentication URL to be passed down to the specified Authentication Handler.

-aM, --auth-method

Possible choices: GET, HEAD, POST, PUT, DELETE

Authentication HTTP request method to be passed down to the specified Authentication Handler (default: GET, case-insensitive).

Default: GET

-aH, --auth-header

Additional headers to apply for sending requests when using the authentication handler. This option can be provided multiple times, each with a value formatted as:

‘Header-Name: value’

Header names are case-insensitive. Quotes can be used in the <value> portion to delimit it. Surrounding spaces are trimmed.

statistics (stats)

Obtain the computation statistics details of a successful job using a reference UUID or URL. If the job is not marked with succeeded status, this will return an error. Only guaranteed by Weaver instances. Pure ‘OGC API - Processes’ servers might not implement this feature.

weaver statistics [--stdout] [--log LOG]
                  [--quiet | --debug | --verbose | --log-level {DEBUG,ERROR,INFO,WARN}]
                  [-h] [-u URL] -j JOB_REFERENCE [-nL | -wL] [-nH | -wH]
                  [-H HEADER]
                  [-F {JSON,JSON+RAW,JSON+STR,TEXT,TXT,XML,XML+RAW,XML+STR,YAML,YML}]
                  [-rT REQUEST_TIMEOUT] [-rR REQUEST_RETRIES]
                  [-aC AUTH_HANDLER_CLASS] [-aI IDENTITY] [-aP PASSWORD]
                  [-aU AUTH_URL] [-aM HTTP_METHOD] [-aH HEADER]
Logging Arguments

Options that configure output logging.

--stdout

Enforce logging to stdout for display in console.

Default: False

--log, --log-file

Output file to write generated logs.

--quiet, -q

Do not output anything else than error.

Default: False

--debug, -d

Enable extra debug logging.

Default: False

--verbose, -v

Output informative logging details.

Default: False

--log-level, -l

Possible choices: DEBUG, ERROR, INFO, WARN

Explicit log level to employ (default: None, case-insensitive).

Required Arguments
-j, --job

Job URL or UUID to run statistics operation. If full Job URL is provided, the instance --url parameter can be omitted.

Optional Arguments
-u, --url

URL of the instance to run operations.

-nL, --no-links

Remove “links” section from returned result body.

Default: True

-wL, --with-links

Preserve “links” section from returned result body (default).

Default: True

-nH, --no-headers

Omit response headers, only returning the result body (default).

Default: False

-wH, --with-headers

Return response headers additionally to the result body.

Default: False

-H, --header

Additional headers to apply for sending requests toward the service. This option can be provided multiple times, each with a value formatted as:

‘Header-Name: value’

Header names are case-insensitive. Quotes can be used in the <value> portion to delimit it. Surrounding spaces are trimmed. Note that overridden headers expected by requests and the service could break some functionalities.

-F, --format

Possible choices: JSON, JSON+RAW, JSON+STR, TEXT, TXT, XML, XML+RAW, XML+STR, YAML, YML

Select an alternative output representation (default: JSON+STR, case-insensitive).

JSON: Representation as JSON (object), which can still be manipulated in code.

JSON+RAW: Representation as JSON content formatted as raw string without any indentation or newlines.

JSON+STR: Representation as JSON content formatted as string with indentation and newlines.

TEXT: Representation as plain text content without any specific reformatting or validation.

TXT: Representation as plain text content without any specific reformatting or validation.

XML: Representation as XML content formatted as serialized string.

XML+RAW: Representation as XML content formatted as raw string without indentation or newlines.

XML+STR: Representation as XML content formatted as string with indentation and newlines.

YAML: Representation as YAML content formatted as string with indentation and newlines.

YML: Alias to YAML.

Request Arguments

Parameters to control specific options related to HTTP request handling.

-rT, --request-timeout

Maximum timout duration (seconds) to wait for a response when performing HTTP requests (default: 5s).

Default: 5

-rR, --request-retries

Amount of attempt to retry HTTP requests in case of failure (default: no retry).

Service Authentication Arguments

Parameters to obtain access to a protected service using a request authentication handler.

-aC, --auth-class, --auth-handler

Script or module path reference to class implementation to handle inline request authentication. Format [path/to/script.py:module.AuthHandlerClass] or [installed.module.AuthHandlerClass] is expected.

Utility definitions are available as:

weaver.cli.BasicAuthHandler weaver.cli.BearerAuthHandler weaver.cli.CookieAuthHandler

Custom implementations are allowed for more advanced use cases.

-aI, --auth-identity, --auth-username

Authentication identity (or username) to be passed down to the specified Authentication Handler.

-aP, --auth-password

Authentication password to be passed down to the specified Authentication Handler.

-aU, --auth-url

Authentication URL to be passed down to the specified Authentication Handler.

-aM, --auth-method

Possible choices: GET, HEAD, POST, PUT, DELETE

Authentication HTTP request method to be passed down to the specified Authentication Handler (default: GET, case-insensitive).

Default: GET

-aH, --auth-header

Additional headers to apply for sending requests when using the authentication handler. This option can be provided multiple times, each with a value formatted as:

‘Header-Name: value’

Header names are case-insensitive. Quotes can be used in the <value> portion to delimit it. Surrounding spaces are trimmed.

results

Obtain the output results from a job successfully executed. This operation can also download them from the remote server if requested.

weaver results [--stdout] [--log LOG]
               [--quiet | --debug | --verbose | --log-level {DEBUG,ERROR,INFO,WARN}]
               [-h] [-u URL] -j JOB_REFERENCE [-nL | -wL] [-nH | -wH]
               [-H HEADER]
               [-F {JSON,JSON+RAW,JSON+STR,TEXT,TXT,XML,XML+RAW,XML+STR,YAML,YML}]
               [-rT REQUEST_TIMEOUT] [-rR REQUEST_RETRIES]
               [-aC AUTH_HANDLER_CLASS] [-aI IDENTITY] [-aP PASSWORD]
               [-aU AUTH_URL] [-aM HTTP_METHOD] [-aH HEADER] [-D] [-O OUT_DIR]
Logging Arguments

Options that configure output logging.

--stdout

Enforce logging to stdout for display in console.

Default: False

--log, --log-file

Output file to write generated logs.

--quiet, -q

Do not output anything else than error.

Default: False

--debug, -d

Enable extra debug logging.

Default: False

--verbose, -v

Output informative logging details.

Default: False

--log-level, -l

Possible choices: DEBUG, ERROR, INFO, WARN

Explicit log level to employ (default: None, case-insensitive).

Required Arguments
-j, --job

Job URL or UUID to run results operation. If full Job URL is provided, the instance --url parameter can be omitted.

Optional Arguments
-u, --url

URL of the instance to run operations.

-nL, --no-links

Remove “links” section from returned result body.

Default: True

-wL, --with-links

Preserve “links” section from returned result body (default).

Default: True

-nH, --no-headers

Omit response headers, only returning the result body (default).

Default: False

-wH, --with-headers

Return response headers additionally to the result body.

Default: False

-H, --header

Additional headers to apply for sending requests toward the service. This option can be provided multiple times, each with a value formatted as:

‘Header-Name: value’

Header names are case-insensitive. Quotes can be used in the <value> portion to delimit it. Surrounding spaces are trimmed. Note that overridden headers expected by requests and the service could break some functionalities.

-F, --format

Possible choices: JSON, JSON+RAW, JSON+STR, TEXT, TXT, XML, XML+RAW, XML+STR, YAML, YML

Select an alternative output representation (default: JSON+STR, case-insensitive).

JSON: Representation as JSON (object), which can still be manipulated in code.

JSON+RAW: Representation as JSON content formatted as raw string without any indentation or newlines.

JSON+STR: Representation as JSON content formatted as string with indentation and newlines.

TEXT: Representation as plain text content without any specific reformatting or validation.

TXT: Representation as plain text content without any specific reformatting or validation.

XML: Representation as XML content formatted as serialized string.

XML+RAW: Representation as XML content formatted as raw string without indentation or newlines.

XML+STR: Representation as XML content formatted as string with indentation and newlines.

YAML: Representation as YAML content formatted as string with indentation and newlines.

YML: Alias to YAML.

-D, --download

Download all found job results file references to output location. If not requested, the operation simply displays the job results (default: False).

Default: False

-O, --outdir

Output directory where to store downloaded files from job results if requested (default: ${CURDIR}/{JobID}/<outputs.files>).

Request Arguments

Parameters to control specific options related to HTTP request handling.

-rT, --request-timeout

Maximum timout duration (seconds) to wait for a response when performing HTTP requests (default: 5s).

Default: 5

-rR, --request-retries

Amount of attempt to retry HTTP requests in case of failure (default: no retry).

Service Authentication Arguments

Parameters to obtain access to a protected service using a request authentication handler.

-aC, --auth-class, --auth-handler

Script or module path reference to class implementation to handle inline request authentication. Format [path/to/script.py:module.AuthHandlerClass] or [installed.module.AuthHandlerClass] is expected.

Utility definitions are available as:

weaver.cli.BasicAuthHandler weaver.cli.BearerAuthHandler weaver.cli.CookieAuthHandler

Custom implementations are allowed for more advanced use cases.

-aI, --auth-identity, --auth-username

Authentication identity (or username) to be passed down to the specified Authentication Handler.

-aP, --auth-password

Authentication password to be passed down to the specified Authentication Handler.

-aU, --auth-url

Authentication URL to be passed down to the specified Authentication Handler.

-aM, --auth-method

Possible choices: GET, HEAD, POST, PUT, DELETE

Authentication HTTP request method to be passed down to the specified Authentication Handler (default: GET, case-insensitive).

Default: GET

-aH, --auth-header

Additional headers to apply for sending requests when using the authentication handler. This option can be provided multiple times, each with a value formatted as:

‘Header-Name: value’

Header names are case-insensitive. Quotes can be used in the <value> portion to delimit it. Surrounding spaces are trimmed.

upload

Upload a local file to the remote server vault for reference in process execution inputs. This operation is accomplished automatically for all execution inputs submitted using local files. [note: feature only available for Weaver instances]

weaver upload [--stdout] [--log LOG]
              [--quiet | --debug | --verbose | --log-level {DEBUG,ERROR,INFO,WARN}]
              [-h] -u URL [-nL | -wL] [-nH | -wH] [-H HEADER]
              [-F {JSON,JSON+RAW,JSON+STR,TEXT,TXT,XML,XML+RAW,XML+STR,YAML,YML}]
              [-rT REQUEST_TIMEOUT] [-rR REQUEST_RETRIES]
              [-aC AUTH_HANDLER_CLASS] [-aI IDENTITY] [-aP PASSWORD]
              [-aU AUTH_URL] [-aM HTTP_METHOD] [-aH HEADER] [-c CONTENT_TYPE]
              -f FILE
Logging Arguments

Options that configure output logging.

--stdout

Enforce logging to stdout for display in console.

Default: False

--log, --log-file

Output file to write generated logs.

--quiet, -q

Do not output anything else than error.

Default: False

--debug, -d

Enable extra debug logging.

Default: False

--verbose, -v

Output informative logging details.

Default: False

--log-level, -l

Possible choices: DEBUG, ERROR, INFO, WARN

Explicit log level to employ (default: None, case-insensitive).

Required Arguments
-u, --url

URL of the instance to run operations.

-f, --file

Local file path to upload to the vault.

Optional Arguments
-nL, --no-links

Remove “links” section from returned result body.

Default: True

-wL, --with-links

Preserve “links” section from returned result body (default).

Default: True

-nH, --no-headers

Omit response headers, only returning the result body (default).

Default: False

-wH, --with-headers

Return response headers additionally to the result body.

Default: False

-H, --header

Additional headers to apply for sending requests toward the service. This option can be provided multiple times, each with a value formatted as:

‘Header-Name: value’

Header names are case-insensitive. Quotes can be used in the <value> portion to delimit it. Surrounding spaces are trimmed. Note that overridden headers expected by requests and the service could break some functionalities.

-F, --format

Possible choices: JSON, JSON+RAW, JSON+STR, TEXT, TXT, XML, XML+RAW, XML+STR, YAML, YML

Select an alternative output representation (default: JSON+STR, case-insensitive).

JSON: Representation as JSON (object), which can still be manipulated in code.

JSON+RAW: Representation as JSON content formatted as raw string without any indentation or newlines.

JSON+STR: Representation as JSON content formatted as string with indentation and newlines.

TEXT: Representation as plain text content without any specific reformatting or validation.

TXT: Representation as plain text content without any specific reformatting or validation.

XML: Representation as XML content formatted as serialized string.

XML+RAW: Representation as XML content formatted as raw string without indentation or newlines.

XML+STR: Representation as XML content formatted as string with indentation and newlines.

YAML: Representation as YAML content formatted as string with indentation and newlines.

YML: Alias to YAML.

-c, --content-type

Content-Type of the file to apply. This should be an IANA Media-Type, optionally with additional parameters such as charset. If not provided, attempts to guess it based on the file extension.

Request Arguments

Parameters to control specific options related to HTTP request handling.

-rT, --request-timeout

Maximum timout duration (seconds) to wait for a response when performing HTTP requests (default: 5s).

Default: 5

-rR, --request-retries

Amount of attempt to retry HTTP requests in case of failure (default: no retry).

Service Authentication Arguments

Parameters to obtain access to a protected service using a request authentication handler.

-aC, --auth-class, --auth-handler

Script or module path reference to class implementation to handle inline request authentication. Format [path/to/script.py:module.AuthHandlerClass] or [installed.module.AuthHandlerClass] is expected.

Utility definitions are available as:

weaver.cli.BasicAuthHandler weaver.cli.BearerAuthHandler weaver.cli.CookieAuthHandler

Custom implementations are allowed for more advanced use cases.

-aI, --auth-identity, --auth-username

Authentication identity (or username) to be passed down to the specified Authentication Handler.

-aP, --auth-password

Authentication password to be passed down to the specified Authentication Handler.

-aU, --auth-url

Authentication URL to be passed down to the specified Authentication Handler.

-aM, --auth-method

Possible choices: GET, HEAD, POST, PUT, DELETE

Authentication HTTP request method to be passed down to the specified Authentication Handler (default: GET, case-insensitive).

Default: GET

-aH, --auth-header

Additional headers to apply for sending requests when using the authentication handler. This option can be provided multiple times, each with a value formatted as:

‘Header-Name: value’

Header names are case-insensitive. Quotes can be used in the <value> portion to delimit it. Surrounding spaces are trimmed.

CLI and Client Examples

Following sections present different typical usage of the Shell CLI Commands and Python Client Commands. Operations are equivalent between the CLI and Python client.

Note

Much more operations and option parameters are available. They are not all necessarily represented in below examples. Explore available arguments using weaver <operation> --help or using the above documentation for Python Client Commands and cli_commands.

For each of the following examples, the client is created as follows:

Python
WEAVER_URL = os.getenv("WEAVER_URL")
client = WeaverClient(url=WEAVER_URL)
Authentication Example

For any operation that requires authentication/authorization to access a protected service targeted by WEAVER_URL, it is possible to either provide the auth parameter during initialization of the weaver.cli.WeaverClient itself (the specific weaver.cli.AuthHandler is reused for all operations), or as argument to individual methods when calling the respective operation (handler only used for that step).

Any class implementation that derives from weaver.cli.AuthHandler or requests.auth.AuthBase can be used for the auth argument. This class must implement the __call__ method taking a single request argument and returning the adjusted request instance. The call should apply any relevant modifications to grant the necessary authentication/authorization details. This __call__ will be performed inline prior to sending the actual request toward the service.

Note

There are multiple predefined handlers available for use:

When using the Shell CLI Commands, the specific weaver.cli.AuthHandler implementation to employ must be provided using the --auth-handler/--auth-class (-aC) argument. This can be an importable (installed) class module reference or a plain Python script path separated with a : character followed by the class name definition. Other --auth prefixed arguments can also be supplied, but their actual use depend on the targeted authentication handler implementation.

Below are examples of possible commands:

Command Line
weaver capabilities \
    -u ${WEAVER_URL} \
    -aC requests_magpie.MagpieAuth \
    -aU ${MAGPIE_URL} \
    -aI ${MAGPIE_USERNAME} \
    -aP ${MAGPIE_PASSWORD}

When using the Python Interface, the desired implementation can be specified directly.

MAGPIE_URL = os.getenv("MAGPIE_URL")
MAGPIE_USERNAME = os.getenv("MAGPIE_USERNAME")
MAGPIE_PASSWORD = os.getenv("MAGPIE_PASSWORD")
client.capabilities(auth=requests_magpie.MagpieAuth(MAGPIE_URL, MAGPIE_USERNAME, MAGPIE_PASSWORD))
Deploy Example

Accomplishes the Deployment request in order to subscribe a new Process in the service. Requires a Weaver or OGC API - Processes - Part 2: Deploy, Replace, Undeploy compliant instance.

The Process can correspond to an Application Package using CWL (i.e.: a script, a Docker application, etc.) or a Remote Provider using an external WPS (XML, JSON) or another OGC API - Processes instance. A Workflow of multiple Process references (possibly of distinct nature) can also be deployed.

See also

Chapter Type of Processes covers supported definitions and further explain each type.

Note

If the Application Package being deployed employs a protected Docker repository reference, access can be provided using the corresponding parameters. Those will be required for later execution of the application in order to retrieve the referenced Docker image.

Note

Content definitions for CWL Application Package and/or the literal Process body can be submitted using either a local file reference, an URL, or a literal string formatted as JSON or YAML. With the Python Interface, the definition can also be provided with a dict directly.

Below is a sample Process deployment using a basic Python script wrapped in a Docker image to ensure all requirements are met. The CWL definition provides all necessary inputs and outputs definition to run the desired Application Package. The contents of below URL definition is also available in Sample CWL definition of a Python script.

Command Line
weaver deploy \
    -u ${WEAVER_URL} \
    -p docker-python-script-report \
    --cwl https://raw.githubusercontent.com/crim-ca/weaver/master/docs/examples/docker-python-script-report.cwl
Python
client.deploy(
    process_id="docker-python-script-report",
    cwl="https://raw.githubusercontent.com/crim-ca/weaver/master/docs/examples/docker-python-script-report.cwl",
)

Sample Output:

{
  "description": "Process successfully deployed.",
  "processSummary": {
    "id": "docker-python-script-report",
    "mutable": true,
    "keywords": [
      "application"
    ],
    "metadata": [],
    "jobControlOptions": [
      "async-execute",
      "sync-execute"
    ],
    "outputTransmission": [
      "reference",
      "value"
    ],
    "processDescriptionURL": "http://schema-example.com/processes/docker-python-script-report",
    "executeEndpoint": "http://schema-example.com/processes/docker-python-script-report/jobs"
  },
  "deploymentDone": true
}
Undeploy Example

Accomplishes the Undeployment request to remove a previously Deployed Process from the service. Requires a Weaver or OGC API - Processes - Part 2: Deploy, Replace, Undeploy compliant instance.

Command Line
weaver undeploy -u ${WEAVER_URL} -p docker-python-script-report
Python
client.undeploy("docker-python-script-report")

Sample Output:

{
  "description": "Process successfully undeployed.",
  "identifier": "docker-python-script-report",
  "undeploymentDone": true
}
GetCapabilities Example

Accomplishes the GetCapabilities request to obtain a list of available Process.

Command Line
weaver capabilities -u ${WEAVER_URL}
Python
client.capabilities()

Sample Output:

{
  "description": "Listing of available processes successful.",
  "processes": [
    "docker-demo-cat",
    "docker-python-script",
    "Echo",
    "file_index_selector",
    "file2string_array",
    "image-utils",
    "jsonarray2netcdf",
    "las2tif",
    "metalink2netcdf",
    "sleep"
  ],
  "page": 0,
  "total": 25
}
DescribeProcess Example

Accomplishes the DescribeProcess request to obtain the Process definition.

Command Line
weaver describe -u ${WEAVER_URL} -p jsonarray2netcdf
Python
client.describe("jsonarray2netcdf")

Sample Output:

{
  "id": "jsonarray2netcdf",
  "title": "JSON array to NetCDF",
  "version": "1.1",
  "abstract": "Extracts and fetches NetCDF files from a JSON file containing an URL string array, and provides them on the output directory.",
  "keywords": [],
  "metadata": [],
  "inputs": {
    "input": {
      "title": "input",
      "formats": [
        {
          "mimeType": "application/json",
          "default": true
        }
      ],
      "minOccurs": "1",
      "maxOccurs": "1"
    }
  },
  "outputs": {
    "output": {
      "title": "output",
      "formats": [
        {
          "mimeType": "application/x-netcdf",
          "default": true
        }
      ]
    }
  },
  "visibility": "public",
  "processEndpointWPS1": "http://schema-example.com/wps",
  "processDescriptionURL": "http://schema-example.com/processes/jsonarray2netcdf/jobs",
  "executeEndpoint": "http://schema-example.com/processes/jsonarray2netcdf/jobs",
  "links": [
    {
      "type": "application/json",
      "title": "Process description.",
      "hreflang": "en-CA",
      "href": "http://schema-example.com/processes/jsonarray2netcdf",
      "rel": "self"
    },
    {
      "type": "application/json",
      "title": "Process description.",
      "hreflang": "en-CA",
      "href": "http://schema-example.com/processes/jsonarray2netcdf",
      "rel": "process-desc"
    },
    {
      "type": "application/json",
      "title": "Process execution endpoint for job submission.",
      "hreflang": "en-CA",
      "href": "http://schema-example.com/processes/jsonarray2netcdf/execution",
      "rel": "execute"
    },
    {
      "type": "application/json",
      "title": "List of registered processes.",
      "hreflang": "en-CA",
      "href": "http://schema-example.com/processes",
      "rel": "collection"
    },
    {
      "type": "application/xml",
      "title": "Service definition.",
      "hreflang": "en-CA",
      "href": "http://schema-example.com/ows/wps?service=WPS&request=GetCapabilities",
      "rel": "service-desc"
    }
  ]
}
Execute Example

Accomplishes the Execute request to launch a Job execution with the specified Process and provided inputs. Execution can also take multiple execution control parameters such as requesting outputs by reference, selecting the (a)synchronous mode to be employed and much more.

See also

Please refer to weaver.cli.WeaverClient.execute() arguments, CLI execute operation and chapter Execute documentation for more details regarding all implications of Job execution. File reference types, request contents, execution modes and other advanced use cases are covered in greater extent.

Note

Parameters available for Status Monitoring can also be provided directly during this operation. This has the effect of executing the Job and immediately monitor the obtained status until the completed status is obtained, or timeout is reached, whichever occurs first.

Note

Any valid local file path given as input for the Job execution will be automatically uploaded toward the service (Weaver required) in order to make it available for the underlying application defined by the Process. The same procedure as the Manual Upload operation is employed to temporarily place the file(s) in the Vault and make it accessible only for the submitted Job. The file(s) submitted this way will be deleted once retrieved by the Process for execution.

In order to use the Shell CLI Commands, the Job inputs definition has been made extremely versatile. Arguments can be provided using literal string entries by repeating -I options followed by their desired KVP definitions. Additional properties can also be supplied in order to specify precisely what needs to be submitted to the Process. Please refer to CLI execute help message for more explanations.

Command Line
weaver execute \
    -u ${WEAVER_URL} \
    -p Echo \
    -I "message='Hello World!'" \
    -I value:int=123456 \
    -I array:float=1.23,4.56 \
    -I multi:File=http://example.com/data.json;=http://other.com/catalog.json \
    -I multi:File=http://another.com/data.json \
    -I single:File=/workspace/data.xml@mediaType=text/xml

Inputs can also be provided using a JSON or YAML Job document (as when running CWL) or using a JSON document matching the schema normally submitted by HTTP request for OGC APi - Processes execution.

When using the Python Interface, the inputs can be provided in the same manner as for the above CLI variations, but it is usually more intuitive to use a Python dict directly.

Python
client.execute("Echo", {
    "message": "Hello World!",
    "value": 123456,
    "array": [1.23, 4.56],
    "multi": [
        {"href": "http://example.com/data.json"},
        {"href": "http://other.com/catalog.json"},
        {"href": "http://another.com/data.json"},
    ],
    "single": {
        "href": "/workspace/data.xml",  # note: uploaded to vault automatically before execution
        "type": "text/xml",
    }
})

Sample Output:

{
  "description": "Job successfully submitted to processing queue. Execution should begin when resources are available.",
  "jobID": "797c0c5e-9bc2-4bf3-ab73-5f3df32044a8",
  "processID": "Echo",
  "status": "accepted",
  "location": "http://schema-example.com/processes/Echo/jobs/797c0c5e-9bc2-4bf3-ab73-5f3df32044a8"
}
Dismiss Example

Accomplishes the Job dismiss request to either cancel an accepted or running Job or to remove any stored results from a successful execution.

Command Line
weaver dismiss -u ${WEAVER_URL} -j "29af3a33-0a3e-477d-863e-efccc97e0b02"
Python
client.dismiss("29af3a33-0a3e-477d-863e-efccc97e0b02")

Sample Output:

{
  "code": "JobDismissed",
  "description": "Job was dismissed and artifacts have been removed.",
  "value": "29af3a33-0a3e-477d-863e-efccc97e0b02",
  "links": [
    {
      "href": "http://schema-example.com/processes/sleep/jobs/29af3a33-0a3e-477d-863e-efccc97e0b02",
      "rel": "status",
      "title": "Job status.",
      "type": "application/json",
      "hreflang": "en-CA"
    },
    {
      "href": "http://schema-example.com/jobs/29af3a33-0a3e-477d-863e-efccc97e0b02",
      "rel": "alternate",
      "title": "Job status generic endpoint.",
      "type": "application/json",
      "hreflang": "en-CA"
    },
    {
      "href": "http://schema-example.com/jobs",
      "rel": "collection",
      "title": "List of submitted jobs.",
      "type": "application/json",
      "hreflang": "en-CA"
    },
    {
      "href": "http://schema-example.com/jobs",
      "rel": "up",
      "title": "List of submitted jobs.",
      "type": "application/json",
      "hreflang": "en-CA"
    }
  ]
}
GetStatus Example

Accomplishes the GetStatus operation to request the current status of a Job.

Command Line
weaver status -u ${WEAVER_URL} -j "797c0c5e-9bc2-4bf3-ab73-5f3df32044a8"
Python
client.status("797c0c5e-9bc2-4bf3-ab73-5f3df32044a8")

Sample Output:

{
  "jobID": "797c0c5e-9bc2-4bf3-ab73-5f3df32044a8",
  "processID": "Echo",
  "providerID": null,
  "type": "process",
  "status": "succeeded",
  "message": "Job succeeded.",
  "created": "2022-06-03T23:46:45.049000+00:00",
  "started": "2022-06-03T23:46:45.077000+00:00",
  "finished": "2022-06-03T23:46:48.134000+00:00",
  "updated": "2022-06-03T23:46:48.135000+00:00",
  "duration": "00:00:03",
  "runningDuration": "PT03S",
  "runningSeconds": 3.057,
  "percentCompleted": 100,
  "progress": 100,
  "links": [
    {
      "title": "Job status.",
      "hreflang": "en-CA",
      "href": "http://schema-example.com/processes/Echo/jobs/797c0c5e-9bc2-4bf3-ab73-5f3df32044a8",
      "type": "application/json",
      "rel": "status"
    },
    {
      "title": "Job monitoring location.",
      "hreflang": "en-CA",
      "href": "http://schema-example.com/processes/Echo/jobs/797c0c5e-9bc2-4bf3-ab73-5f3df32044a8",
      "type": "application/json",
      "rel": "monitor"
    },
    {
      "title": "Job status generic endpoint.",
      "hreflang": "en-CA",
      "href": "http://schema-example.com/jobs/797c0c5e-9bc2-4bf3-ab73-5f3df32044a8",
      "type": "application/json",
      "rel": "alternate"
    },
    {
      "title": "List of submitted jobs.",
      "hreflang": "en-CA",
      "href": "http://schema-example.com/jobs",
      "type": "application/json",
      "rel": "collection"
    },
    {
      "title": "List of submitted jobs.",
      "hreflang": "en-CA",
      "href": "http://schema-example.com/jobs",
      "type": "application/json",
      "rel": "http://www.opengis.net/def/rel/ogc/1.0/job-list"
    },
    {
      "title": "New job submission endpoint for the corresponding process.",
      "hreflang": "en-CA",
      "href": "http://schema-example.com/processes/Echo/jobs/execution",
      "type": "application/json",
      "rel": "http://www.opengis.net/def/rel/ogc/1.0/execute"
    },
    {
      "title": "Submitted job inputs for process execution.",
      "hreflang": "en-CA",
      "href": "http://schema-example.com/processes/Echo/jobs/797c0c5e-9bc2-4bf3-ab73-5f3df32044a8/inputs",
      "type": "application/json",
      "rel": "inputs"
    },
    {
      "title": "Job outputs of successful process execution (extended outputs with metadata).",
      "hreflang": "en-CA",
      "href": "http://schema-example.com/processes/Echo/jobs/797c0c5e-9bc2-4bf3-ab73-5f3df32044a8/outputs",
      "type": "application/json",
      "rel": "outputs"
    },
    {
      "title": "Job results of successful process execution (direct output values mapping).",
      "hreflang": "en-CA",
      "href": "http://schema-example.com/processes/Echo/jobs/797c0c5e-9bc2-4bf3-ab73-5f3df32044a8/results",
      "type": "application/json",
      "rel": "http://www.opengis.net/def/rel/ogc/1.0/results"
    },
    {
      "title": "Job statistics collected following process execution.",
      "hreflang": "en-CA",
      "href": "http://schema-example.com/processes/Echo/jobs/797c0c5e-9bc2-4bf3-ab73-5f3df32044a8/statistics",
      "type": "application/json",
      "rel": "statistics"
    },
    {
      "title": "List of collected job logs during process execution.",
      "hreflang": "en-CA",
      "href": "http://schema-example.com/processes/Echo/jobs/797c0c5e-9bc2-4bf3-ab73-5f3df32044a8/logs",
      "type": "application/json",
      "rel": "logs"
    },
    {
      "title": "Job status.",
      "hreflang": "en-CA",
      "href": "http://schema-example.com/processes/Echo/jobs/797c0c5e-9bc2-4bf3-ab73-5f3df32044a8",
      "type": "application/json",
      "rel": "self"
    },
    {
      "title": "Job status details.",
      "hreflang": "en-CA",
      "href": "http://schema-example.com/processes/Echo/jobs/797c0c5e-9bc2-4bf3-ab73-5f3df32044a8",
      "type": "application/json",
      "rel": "up"
    }
  ]
}
Jobs Example

Accomplishes the Job listing request to obtain known Job definitions using filter search queries.

Command Line
weaver jobs -u ${WEAVER_URL} -nL
Python
client.jobs(with_links=False)

Note

Option -nL and argument with_links are used to omit links section in sample output.

Sample Output:

{
  "jobs": [
    "14c68477-c3ed-4784-9c0f-a4c9e1344db5",
    "f9d8af48-558c-4702-89ba-b94d19304254",
    "08019820-2d84-4a26-ae2d-c0f1ccaabd0b",
    "88dc510f-05b9-4387-a269-501211144a67",
    "137a94a1-b1ef-4363-82b1-78a3c811a8b0",
    "f3036cc4-38b8-413f-9897-22949b6d4b57",
    "d70eac5e-b744-4313-aa97-1ffdcc98f39d",
    "c058fd54-e8a1-42f1-83b8-16b8fa96113d",
    "cb84d046-28eb-4fb2-93b1-b7449e52eef3",
    "7a6f895f-27e2-4949-a448-bb0f262f390c"
  ],
  "limit": 10,
  "page": 0,
  "total": 40
}
Monitor Example

If a Job was summited for execution, it is possible to perform Status Monitoring of this Job until completion or until the specified timeout is reached. This can be performed at any moment on a pending or running Job.

See also

It is possible to directly perform monitoring when calling the Job Execution operation. Simply provide the relevant arguments and options applicable to the monitoring step during the execute call.

Command Line
# assuming job is 'running'
weaver monitor -u ${WEAVER_URL} -j "14c68477-c3ed-4784-9c0f-a4c9e1344db5"
Python
client.results("14c68477-c3ed-4784-9c0f-a4c9e1344db5")

Monitor output should be in as similar format as GetStatus Example with the latest Job status retrieved.

Results Example

Retrieves the Job Results from a successful Job execution.

Note

It is possible to employ the download argument to retrieve File outputs from a Job. If this is enabled, files will be downloaded using the URL references specified in the Job results and store them in the specified local output directory.

Command Line
weaver results -u ${WEAVER_URL} -j "14c68477-c3ed-4784-9c0f-a4c9e1344db5"
Python
client.results("14c68477-c3ed-4784-9c0f-a4c9e1344db5")

Sample Output:

{
  "output": {
    "href": "http://schema-example.com/wpsoutputs/14c68477-c3ed-4784-9c0f-a4c9e1344db5/output.txt",
    "format": {
      "mediaType": "text/plain"
    }
  }
}
Upload Example

This operation allows manual upload of a local file to the Vault.

Note

When running the execute operation, any detected local file reference will be automatically uploaded as Vault file in order to make it available for the remote Weaver server for Process execution.

See also

File Vault Inputs and Uploading File to the Vault provide more details about this feature.

Command Line
weaver upload -u ${WEAVER_URL} -f /path/to/file.txt
Python
client.upload("/path/to/file.txt")

Sample Output:

{
  "description": "File successfully uploaded to vault.",
  "access_token": "<ACCESS_TOKEN>",
  "file_id": "e337a830-dbd6-4915-90ef-bfd46e237a3e",
  "file_href": "vault://e337a830-dbd6-4915-90ef-bfd46e237a3e"
}

Source Code

This page contains reference documentation of the source code.

weaver

Subpackages
weaver.database
Submodules
weaver.database.base
Module Contents
weaver.database.base.AnyStore[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 | Type[weaver.store.base.StoreInterface] | weaver.store.base.StoreInterface) weaver.store.base.StoreTypeName[source]
get_store(store_type: StoreBillsSelector) weaver.store.base.StoreBills[source]
get_store(store_type: StoreQuotesSelector) weaver.store.base.StoreQuotes
get_store(store_type: StoreJobsSelector) weaver.store.base.StoreJobs
get_store(store_type: StoreProcessesSelector) weaver.store.base.StoreProcesses
get_store(store_type: StoreServicesSelector) weaver.store.base.StoreServices
get_store(store_type: StoreVaultSelector) weaver.store.base.StoreVault
get_store(store_type: StoreBillsSelector, *store_args: Any, **store_kwargs: Any) weaver.store.base.StoreBills
get_store(store_type: StoreQuotesSelector, *store_args: Any, **store_kwargs: Any) weaver.store.base.StoreQuotes
get_store(store_type: StoreJobsSelector, *store_args: Any, **store_kwargs: Any) weaver.store.base.StoreJobs
get_store(store_type: StoreProcessesSelector, *store_args: Any, **store_kwargs: Any) weaver.store.base.StoreProcesses
get_store(store_type: StoreServicesSelector, *store_args: Any, **store_kwargs: Any) weaver.store.base.StoreServices
get_store(store_type: StoreVaultSelector, *store_args: Any, **store_kwargs: Any) weaver.store.base.StoreVault
abstract reset_store(store_type: StoreSelector) None[source]
abstract get_session()[source]
abstract get_information() weaver.typedefs.JSON[source]

Obtain information about the database.

The implementing class should provide JSON serializable metadata.

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

Return the unique identifier of db type matching settings.

_revision = 1[source]
_database[source]
_settings[source]
_stores[source]
type = 'mongodb'[source]
reset_store(store_type: weaver.database.base.StoreSelector) AnyMongodbStore[source]
get_store(store_type: weaver.database.base.StoreBillsSelector, *store_args: Any, **store_kwargs: Any) weaver.store.mongodb.MongodbBillStore[source]
get_store(store_type: weaver.database.base.StoreQuotesSelector, *store_args: Any, **store_kwargs: Any) weaver.store.mongodb.MongodbQuoteStore
get_store(store_type: weaver.database.base.StoreJobsSelector, *store_args: Any, **store_kwargs: Any) weaver.store.mongodb.MongodbJobStore
get_store(store_type: weaver.database.base.StoreProcessesSelector, *store_args: Any, **store_kwargs: Any) weaver.store.mongodb.MongodbProcessStore
get_store(store_type: weaver.database.base.StoreServicesSelector, *store_args: Any, **store_kwargs: Any) weaver.store.mongodb.MongodbServiceStore
get_store(store_type: weaver.database.base.StoreVaultSelector, *store_args: Any, **store_kwargs: Any) weaver.store.mongodb.MongodbVaultStore

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() Any[source]
get_information() weaver.typedefs.JSON[source]

Obtain information about the database implementation.

Returns:

JSON with parameters: {"version": "<version>", "type": "<db_type>"}.

is_ready() bool[source]
run_migration() None[source]

Runs any necessary data-schema migration steps.

class weaver.database.mongodb.DecimalCodec[source]

Converter that will automatically perform necessary encoding/decoding of decimal types for MongoDB.

python_type[source]
bson_type[source]
transform_python(value: decimal.Decimal) bson.Decimal128[source]

Convert the given Python object into something serializable.

transform_bson(value: bson.Decimal128) decimal.Decimal[source]

Convert the given BSON value into our own type.

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.AnyRegistryContainer | weaver.typedefs.AnySettingsContainer | None = None, 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.

Note

It is preferable to provide a registry reference to reuse any available connection whenever possible. Giving application settings will require establishing a new connection.

weaver.database.includeme(config: pyramid.config.Configurator) None[source]
weaver.processes
Subpackages
weaver.processes.builtin
Submodules
weaver.processes.builtin.file2string_array

Transforms a file input into JSON file containing an array of file references as value.

Module Contents
weaver.processes.builtin.file2string_array.CUR_DIR[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.process(input_file: str, output_dir: str) None[source]
weaver.processes.builtin.file2string_array.main(*args: str) None[source]
weaver.processes.builtin.file_index_selector
Module Contents
weaver.processes.builtin.file_index_selector.CUR_DIR[source]
weaver.processes.builtin.file_index_selector.LOGGER[source]
weaver.processes.builtin.file_index_selector.select(files: List[str], index: int, output_dir: str) None[source]
weaver.processes.builtin.file_index_selector.main(*args: str) None[source]
weaver.processes.builtin.jsonarray2netcdf
Module Contents
weaver.processes.builtin.jsonarray2netcdf.CUR_DIR[source]
weaver.processes.builtin.jsonarray2netcdf.LOGGER[source]
weaver.processes.builtin.jsonarray2netcdf._handler[source]
weaver.processes.builtin.jsonarray2netcdf.j2n(json_reference: str, output_dir: str) None[source]
weaver.processes.builtin.jsonarray2netcdf.main(*args: str) None[source]
weaver.processes.builtin.metalink2netcdf
Module Contents
weaver.processes.builtin.metalink2netcdf.CUR_DIR[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(*args: str) None[source]
weaver.processes.builtin.utils
Module Contents
weaver.processes.builtin.utils.is_netcdf_url(url: Any) bool[source]

Validates that the reference is a remote NetCDF file reference.

weaver.processes.builtin.utils.validate_reference(url: str, is_file: bool) None[source]

Ensures that the provided reference points to a valid remote file or a temporary intermediate file.

In order to avoid bypassing security validation of server file access between jobs, remote locations must be enforced. However, CWL temporary files must be allowed through for intermediate locations passed around between Workflow steps or employed as temporary writing locations for file extraction purposes.

weaver.processes.builtin.utils.get_package_details(file: os.PathLike[str]) Tuple[str, str, str][source]

Obtains the builtin process details from its file reference.

Package Contents
weaver.processes.builtin.WEAVER_BUILTIN_DIR[source]
weaver.processes.builtin.get_builtin_reference_mapping(root: os.PathLike[str] = WEAVER_BUILTIN_DIR) Dict[str, BuiltinResourceMap][source]

Generates a mapping of reference to actual builtin package file path.

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.

Note

Although any settings can be provided as input, it is better to specify a pyramid.registry.Registry or pyramid.request.Request instance in order to retrieve any pre-established database connection stored as reference. Specifying configuration settings will force recreation of a new database connection.

class weaver.processes.builtin.BuiltinProcess(toolpath_object: ruamel.yaml.comments.CommentedMap, loadingContext: cwltool.context.LoadingContext)[source]

Abstract CWL Process.

Initialize this CommandLineTool.

make_job_runner(runtime_context: cwltool.context.RuntimeContext) Type[cwltool.job.JobBase][source]
Submodules
weaver.processes.constants
Module Contents
weaver.processes.constants.IO_SelectInput_Type[source]
weaver.processes.constants.IO_SelectOutput_Type[source]
weaver.processes.constants.IO_Select_Type[source]
weaver.processes.constants.IO_INPUT[source]
weaver.processes.constants.IO_OUTPUT[source]
weaver.processes.constants.WPS_Literal_Type[source]
weaver.processes.constants.WPS_Reference_Type[source]
weaver.processes.constants.WPS_Complex_Type[source]
weaver.processes.constants.WPS_COMPLEX[source]
weaver.processes.constants.WPS_ComplexData_Type[source]
weaver.processes.constants.WPS_BoundingBoxData_Type[source]
weaver.processes.constants.WPS_BoundingBox_Type[source]
weaver.processes.constants.WPS_BOUNDINGBOX[source]
weaver.processes.constants.WPS_CategoryType[source]
weaver.processes.constants.WPS_LITERAL[source]
weaver.processes.constants.WPS_REFERENCE[source]
weaver.processes.constants.WPS_COMPLEX_DATA[source]
weaver.processes.constants.WPS_BOUNDINGBOX_DATA[source]
weaver.processes.constants.WPS_LiteralDataBoolean_Type[source]
weaver.processes.constants.WPS_LITERAL_DATA_BOOLEAN[source]
weaver.processes.constants.WPS_LiteralDataDateTime_Type[source]
weaver.processes.constants.WPS_LITERAL_DATA_DATETIME[source]
weaver.processes.constants.WPS_LiteralDataFloat_Type[source]
weaver.processes.constants.WPS_LITERAL_DATA_FLOAT[source]
weaver.processes.constants.WPS_LiteralDataInteger_Type[source]
weaver.processes.constants.WPS_LITERAL_DATA_INTEGER[source]
weaver.processes.constants.WPS_LiteralDataString_Type[source]
weaver.processes.constants.WPS_LITERAL_DATA_STRING[source]
weaver.processes.constants.WPS_LiteralData_Type[source]
weaver.processes.constants.WPS_LITERAL_DATA_TYPES[source]
weaver.processes.constants.WPS_ComplexType[source]
weaver.processes.constants.WPS_COMPLEX_TYPES[source]
weaver.processes.constants.WPS_DataType[source]
weaver.processes.constants.WPS_DATA_TYPES[source]
class weaver.processes.constants.OpenSearchField[source]

Constants container that provides similar functionalities to ExtendedEnum without explicit Enum membership.

START_DATE = 'StartDate'[source]
END_DATE = 'EndDate'[source]
AOI = 'aoi'[source]
COLLECTION = 'collection'[source]
LOCAL_FILE_SCHEME = 'opensearchfile'[source]
weaver.processes.constants.CWL_NAMESPACE_ID = 'cwl'[source]
weaver.processes.constants.CWL_NAMESPACE_URL = 'https://w3id.org/cwl/cwl#'[source]
weaver.processes.constants.CWL_NAMESPACE[source]
weaver.processes.constants.CWL_TOOL_NAMESPACE_ID = 'cwltool'[source]
weaver.processes.constants.CWL_TOOL_NAMESPACE_URL = 'http://commonwl.org/cwltool#'[source]
weaver.processes.constants.CWL_TOOL_NAMESPACE[source]
weaver.processes.constants.CWL_RequirementBuiltinType[source]
weaver.processes.constants.CWL_RequirementDockerType[source]
weaver.processes.constants.CWL_RequirementDockerGpuType[source]
weaver.processes.constants.CWL_RequirementESGFCWTType[source]
weaver.processes.constants.CWL_RequirementOGCAPIType[source]
weaver.processes.constants.CWL_RequirementWPS1Type[source]
weaver.processes.constants.CWL_RequirementCUDAType[source]
weaver.processes.constants.CWL_RequirementEnvVarType[source]
weaver.processes.constants.CWL_RequirementInitialWorkDirType[source]
weaver.processes.constants.CWL_RequirementInlineJavascriptType[source]
weaver.processes.constants.CWL_RequirementInplaceUpdateType[source]
weaver.processes.constants.CWL_RequirementLoadListingType[source]
weaver.processes.constants.CWL_RequirementMPIType[source]
weaver.processes.constants.CWL_RequirementNetworkAccessType[source]
weaver.processes.constants.CWL_RequirementProcessGeneratorType[source]
weaver.processes.constants.CWL_RequirementResourceType[source]
weaver.processes.constants.CWL_RequirementScatterFeatureType[source]
weaver.processes.constants.CWL_RequirementSecretsType[source]
weaver.processes.constants.CWL_RequirementToolTimeLimitType[source]
weaver.processes.constants.CWL_RequirementWorkReuseType[source]
weaver.processes.constants.CWL_REQUIREMENT_APP_BUILTIN[source]
weaver.processes.constants.CWL_REQUIREMENT_APP_DOCKER[source]
weaver.processes.constants.CWL_REQUIREMENT_APP_DOCKER_GPU[source]
weaver.processes.constants.CWL_REQUIREMENT_APP_ESGF_CWT[source]
weaver.processes.constants.CWL_REQUIREMENT_APP_OGC_API[source]
weaver.processes.constants.CWL_REQUIREMENT_APP_WPS1[source]
weaver.processes.constants.CWL_RequirementAppTypes[source]
weaver.processes.constants.CWL_REQUIREMENT_APP_TYPES[source]

Set of CWL requirements consisting of known Application Package by this Weaver instance.

weaver.processes.constants.CWL_REQUIREMENT_APP_LOCAL[source]

Set of CWL requirements that correspond to local execution of an Application Package.

weaver.processes.constants.CWL_REQUIREMENT_APP_REMOTE[source]

Set of CWL requirements that correspond to remote execution of an Application Package.

weaver.processes.constants.CWL_REQUIREMENT_CUDA_DEFAULT_PARAMETERS[source]

Parameters employed by default for updating CWL_REQUIREMENT_APP_DOCKER_GPU into CWL_REQUIREMENT_CUDA.

weaver.processes.constants.CWL_REQUIREMENT_CUDA[source]
weaver.processes.constants.CWL_REQUIREMENT_CUDA_NAMESPACE[source]
weaver.processes.constants.CWL_REQUIREMENT_ENV_VAR[source]
weaver.processes.constants.CWL_REQUIREMENT_INIT_WORKDIR[source]
weaver.processes.constants.CWL_REQUIREMENT_INLINE_JAVASCRIPT[source]
weaver.processes.constants.CWL_REQUIREMENT_INPLACE_UPDATE[source]
weaver.processes.constants.CWL_REQUIREMENT_LOAD_LISTING[source]
weaver.processes.constants.CWL_REQUIREMENT_MPI[source]
weaver.processes.constants.CWL_REQUIREMENT_NETWORK_ACCESS[source]
weaver.processes.constants.CWL_REQUIREMENT_PROCESS_GENERATOR[source]
weaver.processes.constants.CWL_REQUIREMENT_RESOURCE[source]
weaver.processes.constants.CWL_REQUIREMENT_SCATTER[source]
weaver.processes.constants.CWL_REQUIREMENT_SECRETS[source]
weaver.processes.constants.CWL_REQUIREMENT_TIME_LIMIT[source]
weaver.processes.constants.CWL_REQUIREMENT_WORK_REUSE[source]
weaver.processes.constants.CWL_REQUIREMENT_FEATURES[source]

Set of CWL requirements that corresponds to extra functionalities not completely defining an Application Package by themselves.

weaver.processes.constants.CWL_REQUIREMENTS_SUPPORTED[source]

Set of all CWL requirements or hints that are supported for deployment of valid Application Package.

weaver.processes.constants.PACKAGE_EXTENSIONS[source]
weaver.processes.constants.PACKAGE_INTEGER_TYPES[source]
weaver.processes.constants.PACKAGE_FLOATING_TYPES[source]
weaver.processes.constants.PACKAGE_NUMERIC_TYPES[source]
weaver.processes.constants.PACKAGE_BASIC_TYPES[source]
weaver.processes.constants.PACKAGE_LITERAL_TYPES[source]
weaver.processes.constants.PACKAGE_FILE_TYPE = 'File'[source]
weaver.processes.constants.PACKAGE_DIRECTORY_TYPE = 'Directory'[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.constants.OAS_COMPLEX_TYPES[source]
weaver.processes.constants.OAS_ARRAY_TYPES[source]
weaver.processes.constants.OAS_LITERAL_TYPES[source]
weaver.processes.constants.OAS_LITERAL_NUMERIC[source]
weaver.processes.constants.OAS_LITERAL_FLOAT_FORMATS[source]
weaver.processes.constants.OAS_LITERAL_INTEGER_FORMATS[source]
weaver.processes.constants.OAS_LITERAL_NUMERIC_FORMATS[source]
weaver.processes.constants.OAS_LITERAL_DATETIME_FORMATS[source]
weaver.processes.constants.OAS_LITERAL_STRING_FORMATS[source]
weaver.processes.constants.OAS_LITERAL_BINARY_FORMATS[source]
weaver.processes.constants.OAS_KEYWORD_TYPES[source]
weaver.processes.constants.OAS_DATA_TYPES[source]
class weaver.processes.constants.ProcessSchema[source]

Schema selector to represent a Process description.

OGC = 'OGC'[source]
OLD = 'OLD'[source]
WPS = 'WPS'[source]
class weaver.processes.constants.JobInputsOutputsSchema[source]

Schema selector to represent a Job output results.

OGC_STRICT = 'ogc+strict'[source]
OLD_STRICT = 'old+strict'[source]
OGC = 'ogc'[source]
OLD = 'old'[source]
weaver.processes.constants.CWL_RequirementNames[source]
weaver.processes.convert

Conversion functions between corresponding data structures.

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.DEFAULT_FORMAT[source]
weaver.processes.convert.DEFAULT_FORMAT_MISSING = '__DEFAULT_FORMAT_MISSING__'[source]
weaver.processes.convert.INPUT_VALUE_TYPE_MAPPING[source]
weaver.processes.convert.UNIT_REGISTRY[source]
weaver.processes.convert.UNIT_OGC_REVERSED: Dict[str, List[str]][source]
weaver.processes.convert.LOGGER[source]
weaver.processes.convert.convert_unit(unit: str) pint.Unit[source]

Convert units considering any known registry names and OGC URN.

Since OGC defines units using URN, they cannot be registered as aliases in UNIT_REGISTRY. This is a limitation from the naming format that requires valid Python identifier names, which is not possible due to the : characters in URN references.

weaver.processes.convert.convert_value_units(value: pint._typing.Scalar, uom: str, to: str) pint._typing.Scalar[source]

Converts the provided value from one UoM to another.

weaver.processes.convert.complex2json(data: owslib.wps.ComplexData | Any) weaver.typedefs.JSON | Any[source]

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

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

Retrieve metadata information and generate its JSON representation.

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.uom2json(uom: str | pywps.inout.basic.UOM | JSON_UoM, ref: str | None = None) JSON_UoM[source]

Convert an UoM definition into corresponding JSON representation.

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: OWS_Output_Type, process_description: owslib.wps.Process, container: weaver.typedefs.AnySettingsContainer | None = 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.any2json_literal_data(data: weaver.typedefs.AnyValueType, data_type: weaver.processes.constants.WPS_LiteralData_Type) weaver.typedefs.AnyValueType[source]

Converts owslib WPS literal data using strings into the specific JSON compatible type.

weaver.processes.convert.ows2json_bbox_data(bbox: owslib.ows.BoundingBox) weaver.typedefs.JSON[source]

Converts owslib WPS Bounding Box data into a JSON representation.

weaver.processes.convert._get_multi_json_references(output: OWS_Output_Type, container: weaver.typedefs.AnySettingsContainer | None) List[weaver.typedefs.JSON] | None[source]

Obtains the JSON contents of a single output corresponding to multi-file references.

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 a JSON with URL references, None otherwise.

weaver.processes.convert.get_io_type_category(io_info: ANY_IO_Type) weaver.processes.constants.WPS_CategoryType[source]

Guesses the applicable I/O type with provided information from any known I/O structure.

weaver.processes.convert._get_cwl_fmt_details(wps_fmt: ANY_Format_Type) Tuple[Tuple[str, str], str, str] | Tuple[None, None, None][source]
weaver.processes.convert._convert_any2cwl_io_complex(cwl_io: weaver.typedefs.CWL_IO_Type, cwl_ns: Dict[str, str], wps_io: JSON_IO_Type | WPS_IO_Type | OWS_IO_Type, io_select: weaver.processes.constants.IO_Select_Type) None[source]

Converts the WPS-like I/O definition and defines them inplace into the CWL containers.

See also

See weaver.processes.wps_process_base.WpsProcessInterface.stage_results() which closely interacts with the produced outputBinding.glob patterns generated here. Methodology should align between them.

Parameters:
  • cwl_io – Basic CWL I/O container (only ID needed) where to write conversion results.

  • cwl_ns – Namespaces to gradually update when encountering new format Media-Type definitions.

  • wps_io – Original WPS-like I/O to be converted.

  • io_select – Context of the I/O.

Returns:

Nothing. Changed inplace.

weaver.processes.convert._get_cwl_js_value_from(cwl_io_symbols: List[weaver.typedefs.AnyValueType], allow_unique: bool, allow_array: bool) str[source]

Obtain the JavaScript valueFrom definition for a CWL input of non-string allowed values.

weaver.processes.convert._convert_cwl_io_enum(cwl_io_type: str | Type[weaver.utils.null], cwl_io_symbols: List[weaver.typedefs.AnyValueType], io_select: weaver.processes.constants.IO_Select_Type, allow_unique: bool, allow_array: bool) weaver.typedefs.CWL_IO_Type[source]

Converts the I/O definition to a CWL I/O that allows Enum-like functionality.

In the event of an explicit string as base type, CWL directly supports type: enum. Other basic types are not directly supported, and must instead perform manual validation against the set of allowed values.

Warning

Because valueFrom can only be used with inputBinding, any output providing a set of allowed values that are not string-based will be ignored when converted to CWL I/O.

Parameters:
  • cwl_io_type – Basic type for which allowed values should apply.

  • cwl_io_symbols – Allowed values to restrict the I/O definition.

Returns:

Converted definition as CWL Enum or with relevant value validation as applicable for the type.

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

Converts a WPS-like I/O from various WPS library representations to CWL I/O.

Conversion can be accomplished for pywps and owslib objects, as well as their JSON equivalent. Because CWL I/O of type File with format field are namespaced, this is also returned if needed.

Returns:

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

weaver.processes.convert._patch_cwl_enum_js_requirement(cwl_package: weaver.typedefs.CWL) None[source]

Applies the JavaScript requirement to validate a pseudo-Enum applied to a CWL input definition.

weaver.processes.convert.wps2cwl_requirement(wps_service_url: 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: str | urllib.parse.ParseResult, wps_provider_name: str | None = None) 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]

Obtains the CWL definition that corresponds to an XML WPS process.

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.ogcapi2cwl_process(payload: weaver.typedefs.JSON, reference: str) Tuple[weaver.typedefs.CWL, weaver.typedefs.JSON][source]

Generate a CWL for a remote OGC API - Processes description to dispatch Process execution.

Parameters:
Returns:

Updated CWL package with the reference to the Process.

weaver.processes.convert.is_cwl_complex_type(io_info: weaver.typedefs.CWL_IO_Type, complex_types: Iterable[weaver.typedefs.CWL_IO_ComplexType] = PACKAGE_COMPLEX_TYPES) bool[source]

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

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

Parameters:
  • io_infoI/O to verify for complex type.

  • complex_types – Complex types to consider. By default, any type between CWL File and Directory are valid. The operation can be limited to one or the other if needed to identify a specific one.

weaver.processes.convert.parse_cwl_array_type(io_info: weaver.typedefs.CWL_IO_Type, strict: bool = True) CWLIODefinition[source]

Parses the specified I/O for one of the various potential CWL array definitions.

Parameters:
  • io_infoCWL I/O definition to parse.

  • strict – Indicates if only pure CWL definition is allowed, or allow implicit data-type conversions.

Returns:

Updated CWL I/O definition with applicable properties.

Raises:

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

weaver.processes.convert.parse_cwl_enum_type(io_info: weaver.typedefs.CWL_IO_Type) CWLIODefinition[source]

Parses the specified I/O for potential CWL enum definition.

Returns:

Updated CWL I/O definition with applicable properties.

Raises:

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

weaver.processes.convert.get_cwl_io_type_name(io_type: Any) Any[source]

Obtain the simple type-name representation of a CWL I/O.

Depending on cwltool version, types are represented with or without an extended prefix, and using an explicit quoted class representation rather than plain strings.

weaver.processes.convert.resolve_cwl_io_type_schema(io_info: weaver.typedefs.CWL_IO_Type, cwl_schema_names: weaver.typedefs.CWL_SchemaNames | None = None) weaver.typedefs.CWL_IO_Type[source]

Reverse CWL schema references by name back to their full CWL I/O definition.

class weaver.processes.convert.CWLIODefinition[source]

Utility CWL I/O definition to contain metadata from parsing results.

name: str = ''[source]

Name (or identifier) or the I/O.

type: CWL_IO_LiteralType | CWL_IO_ComplexType | CWL_IO_DataType[source]

Type of the CWL I/O.

If enum is True, represents the enum base type. If array is True, represents the item type.

Note

Before resolution with parse_cwl_array_type(), this attribute can temporarily hold any CWL type structure (list, dict, nested types, etc.). After parsing, it will be resolved to the basic string type.

null: bool = False[source]

Indicates if the I/O is nullable.

This is obtained from a type composed of "null" and something else, or using the shorthand {type}? notation.

min_occurs: int = 1[source]

Minimum number of occurrences allowed.

When null is True, it is equal to 0. Otherwise, it is greater or equal to 1. If greater than 1, array should be True.

max_occurs: int = 1[source]

Maximum number of occurrences allowed.

Applies only when array is True. Otherwise, always equal to 1. Can take the value PACKAGE_ARRAY_MAX_SIZE to represent "unbounded" occurrences.

array: bool = False[source]

Specifies if the I/O is of array type.

enum: bool = False[source]

Specifies if the I/O is of enum type.

symbols: CWL_IO_EnumSymbols | AnyValue | Type[AnyValue][source]

Specifies the allowed values when the definition is marked as enum.

When not overriden by literal values, it uses the default AnyValue.

mode: pywps.validator.mode.MODE[source]

Validation mode to be applied if I/O requires it.

Defaults to MODE.NONE. Indicates how strict the validation must be. Usually applies when an enum must only allow a specific set of symbols. Can also be used with Media-Types in more advanced validation use case with pywps.

keys() List[str][source]
weaver.processes.convert.get_cwl_io_type(io_info: weaver.typedefs.CWL_IO_Type, strict: bool = True, cwl_schema_names: weaver.typedefs.CWL_SchemaNames | None = None) CWLIODefinition[source]

Obtains the basic type of the CWL input and identity if it is optional.

CWL allows multiple shorthand representation or combined types definition. The base type must be extracted in order to identify the expected data format and supported values.

Obtains real type if "default" or shorthand "<type>?" was in CWL, which can also be defined as type ["null", <type>].

CWL allows multiple distinct types (e.g.: string and int simultaneously), but not WPS inputs. WPS allows only different amount of same type through minOccurs and maxOccurs. Considering WPS conversion, we can also have the following definition ["null", <type>, <array-type>] will all basic types matching exactly. Whether single or array-like type, the base type can be extracted.

Parameters:
  • io_infoCWL definition to parse.

  • strict – Indicates if only pure CWL definition is allowed, or allow implicit data-type conversions.

  • cwl_schema_names – Mapping of CWL type schema references to resolve in long form if used in a definition.

Returns:

tuple of guessed base type and flag indicating if it can be null (optional input).

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

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

Parameters:
  • io_info – parsed IO of a CWL file

  • io_selectIO_INPUT or IO_OUTPUT to specify desired WPS type conversion.

Returns:

corresponding IO in WPS format

weaver.processes.convert.cwl2json_input_values(data: Dict[str, weaver.typedefs.CWL_IO_Value], schema: weaver.processes.constants.ProcessSchemaType = ProcessSchema.OGC) weaver.typedefs.ExecutionInputs[source]

Converts CWL formatted Job inputs to corresponding OGC API - Processes format.

Parameters:
  • data – dictionary with inputs formatted as key-value pairs with relevant structure based on CWL types.

  • schema – either OGC or OLD format respectively for mapping/listing representations.

Raises:
  • TypeError – if input data is invalid.

  • ValueError – if any input value could not be parsed with expected schema.

Returns:

converted inputs for Job submission either in OGC or OLD format.

weaver.processes.convert.convert_input_values_schema(inputs: weaver.typedefs.ExecutionInputs, schema: weaver.processes.constants.JobInputsOutputsSchema.OGC) weaver.typedefs.ExecutionInputsMap[source]
weaver.processes.convert.convert_input_values_schema(inputs: weaver.typedefs.ExecutionInputs, schema: weaver.processes.constants.JobInputsOutputsSchema.OLD) weaver.typedefs.ExecutionInputsList

Convert execution input values between equivalent formats.

Parameters:
  • inputs – Inputs to convert.

  • schema – Desired schema.

Returns:

Converted inputs.

weaver.processes.convert.convert_output_params_schema(inputs: weaver.typedefs.ExecutionOutputs, schema: weaver.processes.constants.JobInputsOutputsSchema.OGC) weaver.typedefs.ExecutionOutputsMap[source]
weaver.processes.convert.convert_output_params_schema(inputs: weaver.typedefs.ExecutionOutputs, schema: weaver.processes.constants.JobInputsOutputsSchema.OLD) weaver.typedefs.ExecutionOutputsList

Convert execution output parameters between equivalent formats.

Warning

These outputs are not values (i.e.: results), but submitted Job outputs for return definitions. Contents are transferred as-is without any consideration of value or href fields.

Parameters:
  • outputs – Outputs to convert.

  • schema – Desired schema.

Returns:

Converted outputs.

weaver.processes.convert.repr2json_input_params(value: str, converter: Callable[[str], Any] | None = None) DataInputType[source]

Extracts and converts the value and its associated parameters from a KVP string representation.

This function only interprets a pre-extracted single-value definition (i.e.: without the input ID) from a parent KVP string.

See also

Use repr2json_input_values() For parsing multi-value arrays and the full KVP including the ID.

Parameters:
  • value – String representation of the value to be interpreted.

  • converter – Conversion function of the value after parsing.

Returns:

Converted value and additional parameters if applicable.

weaver.processes.convert.repr2json_input_values(inputs: List[str]) weaver.typedefs.ExecutionInputsList[source]

Converts inputs in string KVP representation to corresponding JSON values.

Expected format of the input is as follows:

input_id[:input_type]=input_value[@input_parameter][;input_array[@input_parameter]][;...]
Where:
  • input_id represents the target identifier of the input

  • input_type represents the conversion type, as required (includes File for href instead of value key in resulting object)

  • input_value represents the desired value subject to conversion by input_type

  • input_array represents any additional values for array-like inputs (maxOccurs > 1)

  • input_parameter represents additional KVP details associated to each input_value/input_array part (i.e.: per array element if applicable)

The separator character for representing array-like values is ; because the full KVP (already split into a list as argument to this function), could be formed of multiple comma (,) or ampersand (&) separated input definitions, depending on where the definition came from (e.g.: URI).

The input_parameter portion can combine multiple parameters each separated by @ and themselves formed with KVP representation of the corresponding parameter names and values. Parameter names do not need to be consistent between distinct array elements. For example, a multi-parameters input could be formatted as follows:

input_id=item_value1@param1=value1@param2=value2;item_value2@other1=value1

Note

  • Any character that matches one of the separators that should be interpreted literally should be URL-encoded.

  • Single (') and double (") quotes are removed if they delimit a File reference.

Parameters:

inputs – list of string inputs to parse.

Returns:

parsed inputs if successful.

weaver.processes.convert.any2cwl_literal_datatype(io_type: str) 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 | weaver.processes.constants.WPS_LiteralData_Type, is_value: bool = False, pywps: bool = False) 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.

Parameters:
  • io_type – Type to convert to WPS supported literal data type.

  • is_value – If enabled, consider io_type literal data itself to attempt detection of the type.

  • pywps – If enabled, restrict only to types supported by pywps (subset of full WPS).

weaver.processes.convert.any2json_literal_allowed_value(io_allow: pywps.inout.literaltypes.AllowedValue | weaver.typedefs.JSON | str | float | int | bool) weaver.typedefs.JSON | str | str | float | int | bool | Type[weaver.utils.null][source]

Converts an AllowedValues definition from different packages into standardized JSON representation of OGC-API.

weaver.processes.convert.any2json_literal_data_domains(io_info: ANY_IO_Type) Type[weaver.utils.null] | List[weaver.typedefs.JSON][source]

Extracts allowed value constrains from the input definition and generate the expected literal data domains.

The generated result, if applicable, corresponds to a list of a single instance of schema definition weaver.wps_restapi.swagger_definitions.LiteralDataDomainList with following structure.

default: bool
defaultValue: float, int, bool, str
dataType: {name: string, <reference: url: string>}
UOMs:
  - default: {uom: string, reference: url-string}
  - supported: [{uom: string, reference: url-string}]
valueDefinition:
  oneOf:
  - string
  - url-string
  - {anyValue: bool}
  - [float, int, bool, str]
  - [{minimum: number/none, maximum: number/none, spacing: number/none, closure: str open/close variations}]
weaver.processes.convert.json2oas_io_complex(io_info: JSON_IO_Type, io_hint: weaver.typedefs.OpenAPISchema | Type[weaver.utils.null] = null) weaver.typedefs.OpenAPISchema[source]

Convert a single-dimension complex JSON I/O definition into corresponding OpenAPI schema.

weaver.processes.convert.json2oas_io_bbox(io_info: JSON_IO_Type, io_hint: weaver.typedefs.OpenAPISchema | Type[weaver.utils.null] = null) weaver.typedefs.OpenAPISchema[source]

Convert a single-dimension bounding box JSON I/O definition into corresponding OpenAPI schema.

See also

sd.OGC_API_BBOX_SCHEMA

weaver.processes.convert.json2oas_io_literal_data_type(io_type: str) weaver.typedefs.JSON[source]

Converts various literal data types into corresponding OpenAPI fields.

weaver.processes.convert.json2oas_io_allowed_values(io_base: weaver.typedefs.JSON, io_allowed: weaver.typedefs.JSON) List[weaver.typedefs.JSON][source]

Converts literal data allowed values JSON definitions ino OpenAPI equivalent variations.

Parameters:
  • io_base – Base value definitions that can be shared across variations (e.g.: default values).

  • io_allowed – Allowed values definitions (enum, ranges) extracted from JSON literal data domains.

Returns:

List of converted OpenAPI definitions applicable to represent the allowed values.

weaver.processes.convert.json2oas_io_literal(io_info: JSON_IO_Type, io_hint: weaver.typedefs.OpenAPISchema | Type[weaver.utils.null] = null) weaver.typedefs.OpenAPISchema[source]

Convert a single-dimension literal value JSON I/O definition into corresponding OpenAPI schema.

weaver.processes.convert.json2oas_io(io_info: JSON_IO_Type, io_hint: weaver.typedefs.OpenAPISchema | Type[weaver.utils.null] = null) weaver.typedefs.OpenAPISchema[source]

Converts definitions from a JSON Process I/O definition into corresponding OpenAPI schema.

Parameters:
  • io_infoWPS I/O definition to generate a corresponding OpenAPI schema.

  • io_hint – Reference OpenAPI definition that can improve more explicit object definitions.

weaver.processes.convert.oas2json_io_literal(io_info: weaver.typedefs.OpenAPISchemaProperty) JSON_IO_TypedInfo | Type[weaver.utils.null][source]

Converts a literal value I/O definition by OpenAPI schema into the equivalent JSON representation.

Parameters:

io_infoOpenAPI schema of the I/O.

Returns:

Converted JSON I/O definition, or null if definition could not be resolved.

weaver.processes.convert.oas2json_io_array(io_info: weaver.typedefs.OpenAPISchemaArray) JSON_IO_TypedInfo | Type[weaver.utils.null][source]

Converts an array I/O definition by OpenAPI schema into the equivalent JSON representation.

Parameters:

io_infoOpenAPI schema of the I/O.

Returns:

Converted JSON I/O definition, or null if definition could not be resolved.

weaver.processes.convert.oas2json_io_object(io_info: weaver.typedefs.OpenAPISchemaObject, io_href: str = null) JSON_IO_TypedInfo | Type[weaver.utils.null][source]

Converts an object I/O definition by OpenAPI schema into the equivalent JSON representation.

An explicit OpenAPI schema with object type can represent any of the following I/O:

  • Bounding Box as GeoJSON feature

  • Complex JSON structure

See also

oas2json_io_file() is used for file reference to be parsed as other Complex I/O.

Parameters:
  • io_infoOpenAPI schema of the I/O.

  • io_href – Alternate schema reference for the type.

Returns:

Converted JSON I/O definition, or null if definition could not be resolved.

weaver.processes.convert.oas2json_io_keyword(io_info: weaver.typedefs.OpenAPISchemaKeyword) JSON_IO_TypedInfo | Type[weaver.utils.null][source]

Converts a keyword I/O definition by OpenAPI schema into the equivalent JSON representation.

Keywords are defined as a list of combinations of OpenAPI schema representing how to combine them according to the keyword value, being one of OAS_KEYWORD_TYPES.

Parameters:

io_infoOpenAPI schema of the I/O.

Returns:

Converted JSON I/O definition, or null if definition could not be resolved.

weaver.processes.convert.oas2json_io_file(io_info: weaver.typedefs.OpenAPISchemaObject, io_href: str = null) JSON_IO_TypedInfo[source]

Converts a file reference I/O definition by OpenAPI schema into the equivalent JSON representation.

Parameters:
  • io_infoOpenAPI schema of the I/O.

  • io_href – Alternate schema reference for the type.

Returns:

Converted JSON I/O definition, or null if definition could not be resolved.

weaver.processes.convert.oas2json_io_measure(io_info: weaver.typedefs.OpenAPISchemaObject) JSON_IO_TypedInfo | Type[weaver.utils.null][source]

Convert a unit of measure (UoM) I/O definition by OpenAPI schema into JSON representation.

This conversion projects an object (normally complex type) into a literal type, considering that other provided parameters are all metadata information.

Parameters:

io_info – Potential OpenAPI schema of an UoM I/O.

Returns:

Converted I/O if it matched the UoM format, or null otherwise.

weaver.processes.convert.oas2json_io(io_info: weaver.typedefs.OpenAPISchema) JSON_IO_TypedInfo | Type[weaver.utils.null][source]

Converts an I/O definition by OpenAPI schema into the equivalent JSON representation.

Parameters:

io_infoOpenAPI schema of the I/O.

Returns:

Converted JSON I/O definition, or null if definition could not be resolved.

weaver.processes.convert.oas_resolve_remote(io_info: weaver.typedefs.OpenAPISchema) weaver.typedefs.OpenAPISchema[source]

Perform remote OpenAPI schema $ref resolution.

Resolution is performed only sufficiently to provide enough context for following JSON I/O conversion. Remote references are not resolved further than required to speedup loading time and avoid recursive error on self-referring schema. Passed sufficient levels of schema definitions, the specific contents is not important nor needs to be resolved as there is they cannot be mapped to anything else than WPS_COMPLEX I/O type.

Parameters:

io_infoI/O OpenAPI schema to attempt resolution as applicable.

Returns:

Resolved I/O schema or directly the provided schema returned unmodified if no references need resolution.

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

Converts a JSON input definition into the corresponding pywps parameters.

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

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

Converts an I/O field from JSON literal, 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_supported_uoms(io_info: JSON_IO_Type) Type[weaver.utils.null] | List[pywps.inout.basic.UOM][source]

Obtains instances of supported Unit of Measure (UoM) from a JSON I/O definition.

weaver.processes.convert.json2wps_allowed_values(io_info: JSON_IO_Type) Type[weaver.utils.null] | List[pywps.inout.literaltypes.AllowedValue][source]

Obtains the allowed values constrains for the literal data type from a JSON I/O definition.

Converts the literalDataDomains definition into allowed_values understood by pywps. Handles explicit allowed_values if available and not previously defined by literalDataDomains.

See also

Function any2json_literal_data_domains() defines generated literalDataDomains JSON definition.

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

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

Parameters:
  • io_infoI/O in JSON dict format.

  • io_selectIO_INPUT or IO_OUTPUT to specify desired WPS type conversion.

Returns:

corresponding I/O in WPS format.

weaver.processes.convert.wps2json_io(io_wps: WPS_IO_Type, forced_fields: bool = False) JSON_IO_Type[source]

Converts a pywps I/O into a JSON dictionary with corresponding standard keys names.

Employs standard key names as defined by WPS 2.0.

Parameters:
  • io_wps – Any pywps I/O definition to be converted to JSON representation.

  • forced_fields – Request transfer of additional fields normally undefined for outputs if they are available by being forcefully inserted in the objects after their creation (i.e.: using set_field()). These fields can be useful for obtaining mandatory details for further processing operations (e.g.: OpenAPI schema conversion).

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: weaver.typedefs.JSON | object, field: str, search_variations: bool = False, extra_variations: List[str] | None = None, only_variations: bool = False, pop_found: bool = False, key: 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.

When search_variation is enabled and that field could not be found within the object, field lookup will employ the values under the field entry within WPS_FIELD_MAPPING as additional field names to search for an existing property or key. Search continues until the first match is found, respecting order within the variations listing, and finally uses default if no match was found.

Parameters:
  • io_object – Any I/O representation, either as a class instance or JSON container.

  • field – Name of the field to look for, either as property or key name based on input object type.

  • search_variations – If enabled, search for all variations to the field name to attempt search until matched.

  • extra_variations – Additional field names to consider as search variations, with priority over field mapping.

  • only_variations – If enabled, skip the first ‘basic’ field and start search directly with field variations.

  • pop_found – If enabled, whenever a match is found by field or variations, remove that entry from the object.

  • key – If enabled, whenever a match is found by field or variations, return matched key instead of the value.

  • default – Alternative default value to return if no match could be found.

Returns:

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

weaver.processes.convert.set_field(io_object: weaver.typedefs.JSON | object, 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]

Verifies if two items are set and are different of different “representative” value.

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 rather than literal values 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: pywps.inout.formats.Format | weaver.typedefs.JSON, format2: pywps.inout.formats.Format | weaver.typedefs.JSON) bool[source]

Verifies for matching formats.

weaver.processes.convert.normalize_ordered_io(io_section: JSON_IO_ListOrMap, order_hints: JSON_IO_ListOrMap | None = None) List[weaver.typedefs.JSON][source]

Reorders and converts I/O from any representation (dict or list) using ordering hints.

First, converts I/O definitions defined as dictionary to an equivalent list representation, in order to work only with a single representation method. The list is chosen over dict because sequences can enforce a specific order, while mapping (when saved as JSON or YAML) have no specific order. The list representation ensures that I/O order is preserved when written to file and reloaded afterwards regardless of server and/or library’s implementation of the mapping 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 parsers. This is merely cosmetic adjustments to ease readability of I/O to avoid always shuffling their order across multiple Application Package and Process reporting formats.

The important result of this function is to provide the 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.

This function is intended for parsing I/O from Process descriptions, Application Package and other definitions that employ a "type" field. For submitted execution I/O values, refer to other relevant functions.

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

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

Returns:

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

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_io_fields(wps_io: WPS_IO_Type, cwl_io: WPS_IO_Type) WPS_IO_Type[source]

Combines corresponding I/O fields from WPS and CWL definitions.

See also

cwl2wps_io() for conversion of CWL to WPS representation.

Parameters:
  • wps_io – Original WPS I/O provided in the process definition during deployment.

  • cwl_io – Converted CWL I/O into WPS representation for matching similar details.

Returns:

Merged I/O definition.

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

Merges corresponding parameters of different I/O definition sources.

Handled definition formats include I/O representation for CWL, OpenAPI, WPS and generic JSON using properties resembling pywps or owslib objects.

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. If an OpenAPI schema definition was provided to define the I/O, infer the corresponding WPS I/O details. Then, considering those resolved definitions and any missing information that could be inferred, extend 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, since they will be of no use for the underlying Application Package. Adds missing deployment WPS I/O definitions using expected CWL I/O IDs.

See also

cwl2wps_io() for conversion of CWL to WPS representation.

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_selectIO_INPUT or IO_OUTPUT to specify desired WPS type conversion.

Returns:

List of updated JSON I/O combing CWL, WPS and OpenAPI specifications.

weaver.processes.convert.check_io_compatible(wps_io: WPS_IO_Type, cwl_io: WPS_IO_Type, io_id: str) None[source]

Validate types to ensure they match categories, otherwise merging will cause more confusion.

For Literal/Complex I/O coming from WPS side, they should be matched exactly with Literal/Complex I/O on the CWL side.

Note

The :term`CWL` I/O in this case is expected to be a pywps converted I/O from the :term`CWL` definition, and not a direct :term`CWL` I/O definition.

Warning

When BoundingBox for WPS, it should be mapped to ComplexInput on CWL side (since no equivalent).

Raises:

PackageTypeError – If I/O are not compatible.

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: weaver.wps.service.WorkerRequest, update_status: weaver.typedefs.UpdateStatusPartialFunction)[source]

Common interface for WPS Process to be used for dispatching CWL jobs.

Multiple convenience methods are provided. Processes inheriting from this base should implement required abstract methods and override operations as needed.

Note

For expected operations details and their execution order, please refer to Workflow Step Operations.

See also

execute() for complete details of the operations and ordering.

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

Execute an ESGF process from cwl inputs.

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

Convert inputs from cwl inputs to ESGF format.

static _get_domain(workflow_inputs: weaver.typedefs.JSON) cwt.Domain | None[source]
_check_required_inputs(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(api_key: str, inputs: List[cwt.Variable], domain: cwt.Domain | None = None) cwt.Process[source]

Run an ESGF process.

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

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

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

Process the result of the execution.

_write_outputs(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]
class weaver.processes.execution.JobProgress[source]

Job process execution progress.

SETUP = 1[source]
DESCRIBE = 2[source]
GET_INPUTS = 3[source]
GET_OUTPUTS = 4[source]
EXECUTE_REQUEST = 5[source]
EXECUTE_STATUS_LOCATION = 6[source]
EXECUTE_MONITOR_START = 7[source]
EXECUTE_MONITOR_LOOP = 8[source]
EXECUTE_MONITOR_DONE = 96[source]
EXECUTE_MONITOR_END = 98[source]
NOTIFY = 99[source]
DONE = 100[source]
weaver.processes.execution.execute_process(task: celery.app.task.Task, job_id: uuid.UUID, wps_url: str, headers: weaver.typedefs.HeadersType | None = None) weaver.status.StatusType[source]

Celery task that executes the WPS process job monitoring as status updates (local and remote).

weaver.processes.execution.collect_statistics(process: psutil.Process | None, settings: weaver.typedefs.SettingsType | None = None, job: weaver.datatype.Job | None = None, rss_start: int | None = None) weaver.typedefs.Statistics | None[source]

Collect any available execution statistics and store them in the Job if provided.

weaver.processes.execution.fetch_wps_process(job: weaver.datatype.Job, wps_url: str, headers: weaver.typedefs.HeadersType, settings: weaver.typedefs.SettingsType) weaver.processes.convert.ProcessOWS[source]

Retrieves the WPS process description from the local or remote WPS reference URL.

weaver.processes.execution.parse_wps_input_format(input_info: weaver.typedefs.JSON, type_field: str = 'mime_type', search_variations: bool = True) Tuple[str | None, str | None][source]
weaver.processes.execution.parse_wps_input_complex(input_value: str | weaver.typedefs.JSON, input_info: weaver.typedefs.JSON) owslib.wps.ComplexDataInput[source]

Parse the input data details into a complex input.

weaver.processes.execution.parse_wps_input_bbox(input_value: str | weaver.typedefs.JobValueBbox, input_info: weaver.typedefs.JSON) owslib.wps.BoundingBoxDataInput[source]

Parse the input data details into a bounding box input.

weaver.processes.execution.parse_wps_input_literal(input_value: weaver.typedefs.AnyValueType | weaver.typedefs.JSON) str | None[source]

Parse the input data details into a literal input.

weaver.processes.execution.parse_wps_inputs(wps_process: weaver.processes.convert.ProcessOWS, job: weaver.datatype.Job) List[Tuple[str, weaver.processes.convert.OWS_Input_Type]][source]

Parses expected WPS process inputs against submitted job input values considering supported process definitions.

weaver.processes.execution.make_results_relative(results: List[weaver.typedefs.JSON], settings: weaver.typedefs.SettingsType) List[weaver.typedefs.JSON][source]

Converts file references to a pseudo-relative location to allow the application to dynamically generate paths.

Redefines job results to be saved in database as pseudo-relative paths to configured WPS output directory. This allows the application to easily adjust the exposed result HTTP path according to the service configuration (i.e.: relative to weaver.wps_output_dir and/or weaver.wps_output_url) and it also avoids rewriting the database job results entry if those settings are changed later on following reboot of the web application.

Only references prefixed with weaver.wps_output_dir, weaver.wps_output_url or a corresponding resolution from weaver.wps_output_path with weaver.url will be modified to pseudo-relative paths. Other references (file/URL endpoints that do not correspond to Weaver) will be left untouched for literal remote reference. Results that do not correspond to a reference are also unmodified.

Note

The references are not real relative paths (i.e.: starting with ./), as those could also be specified as input, and there would be no way to guarantee proper differentiation from paths already handled and stored in the database. Instead, pseudo-relative paths employ an explicit absolute-like path (i.e.: starting with /) and are assumed to always require to be prefixed by the configured WPS locations (i.e.: weaver.wps_output_dir or weaver.wps_output_url based on local or HTTP response context).

With this approach, data persistence with mapped volumes into the dockerized Weaver service can be placed anywhere at convenience. This is important because sibling docker execution require exact mappings such that volume mount /data/path:/data/path resolve correctly on both sides (host and image path must be identical). If volumes get remapped differently, ensuring that weaver.wps_output_dir setting follows the same remapping update will automatically resolve to the proper location for both local references and exposed URL endpoints.

Parameters:
  • results – JSON mapping of data results as {"<id>": <definition>} entries where a reference can be found.

  • settings – container to retrieve current application settings.

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

Maps directory locations between pywps process execution and produced jobs storage.

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: weaver.datatype.Service | weaver.datatype.Process, tags: List[str] | None = None) weaver.typedefs.AnyResponseType[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.submit_job_handler(payload: weaver.typedefs.ProcessExecution, settings: weaver.typedefs.SettingsType, service_url: str, provider: weaver.typedefs.AnyServiceRef | None = None, process: weaver.typedefs.AnyProcessRef = None, is_workflow: bool = False, is_local: bool = True, visibility: weaver.visibility.AnyVisibility | None = None, language: str | None = None, headers: weaver.typedefs.HeaderCookiesType | None = None, tags: List[str] | None = None, user: int | None = None, context: str | None = None) weaver.typedefs.AnyResponseType[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.execution.validate_process_io(process: weaver.datatype.Process, payload: weaver.typedefs.ProcessExecution) None[source]

Preemptively verify submitted parameters for execution against expected process definition.

Verify missing inputs or obvious type mismatches, but nothing too over-complicated. The ideas behind this function is to avoid unnecessary assignation of celery worker and Docker resources that would be guaranteed to fail as soon as the process execution started.

This function is NOT intended to catch all erroneous inputs, nor validate their values. For example, out-of-range values or unreachable file reference URLs are not guaranteed. However, basic checks such as unacceptable types or cardinality can be performed. Assumes that schema pre-validation was accomplished to minimally guarantee that the structure is valid.

Parameters:
  • process – Process description that provides expected inputs and outputs.

  • payload – Submitted job execution body.

Raises:

HTTPException – Corresponding error for detected invalid combination of inputs or outputs.

weaver.processes.ogc_api_process
Module Contents
class weaver.processes.ogc_api_process.OGCAPIRemoteProcess(step_payload: weaver.typedefs.JSON, process: str, request: weaver.wps.service.WorkerRequest, update_status: weaver.typedefs.UpdateStatusPartialFunction)[source]

Common interface for WPS Process to be used for dispatching CWL jobs.

Multiple convenience methods are provided. Processes inheriting from this base should implement required abstract methods and override operations as needed.

Note

For expected operations details and their execution order, please refer to Workflow Step Operations.

See also

execute() for complete details of the operations and ordering.

process_type = 'OGC API'[source]
weaver.processes.opensearch
Module Contents
weaver.processes.opensearch.LOGGER[source]
weaver.processes.opensearch.alter_payload_after_query(payload: weaver.typedefs.JSON) weaver.typedefs.JSON[source]

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

weaver.processes.opensearch.WKT_BBOX_BOUNDS[source]
weaver.processes.opensearch.load_wkt_bbox_bounds(wkt: str) str[source]
weaver.processes.opensearch.validate_bbox(bbox: str) None[source]

Validate bounding box formatted as x1, y1, x2, y2 string composed of floating point numbers.

weaver.processes.opensearch.query_eo_images_from_wps_inputs(wps_inputs: Dict[str, Deque], eoimage_source_info: Dict[str, weaver.typedefs.DataSourceOpenSearch], accept_mime_types: Dict[str, List[str]], settings: weaver.typedefs.AnySettingsContainer | None = None) Dict[str, Deque[weaver.processes.convert.WPS_Input_Type]][source]

Query OpenSearch using parameters in inputs and return file links.

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: str) str[source]

Replaces file:// scheme by opensearch:// scheme.

class weaver.processes.opensearch.OpenSearchQuery(collection_identifier: str, osdd_url: str, catalog_search_field: str = 'parentIdentifier', settings: weaver.typedefs.AnySettingsContainer | None = None)[source]

Container to handle OpenSearch queries.

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() str[source]
_prepare_query_url(template_url: str, params: Dict) Tuple[str, weaver.typedefs.JSON][source]

Prepare the URL for the OpenSearch query.

Parameters:
  • template_url – url containing query parameters.

  • params – parameters to insert in formatted URL.

_query_features_paginated(params: weaver.typedefs.JSON) Iterator[weaver.typedefs.JSON, str][source]

Iterates over paginated results until all features are retrieved.

Parameters:

params – query parameters

query_datasets(params: weaver.typedefs.JSON, accept_schemes: List[str], accept_mime_types: List[str]) Iterator[str][source]

Query the specified datasets.

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: weaver.typedefs.JSON) List[Tuple[str, str]][source]

Retrieve the values from the additionalParameters of the input.

Parameters:

input_data – Dict containing or not the “additionalParameters” key

class weaver.processes.opensearch.EOImageDescribeProcessHandler(inputs: List[weaver.processes.convert.JSON_IO_Type])[source]
static is_eoimage_input(input_data: weaver.typedefs.JSON) bool[source]
static get_allowed_collections(input_data: weaver.typedefs.JSON) List[str][source]
static make_aoi(id_: str) weaver.typedefs.JSON[source]
static make_collection(identifier: str, allowed_values: List[str]) weaver.typedefs.JSON[source]
static make_toi(id_: str, start_date: bool = True) weaver.typedefs.JSON[source]

Generate the Time-Of-Interest definition.

Parameters:
  • id – ID of the input.

  • start_date – (Default value = True)

to_opensearch(unique_aoi: bool, unique_toi: bool) List[weaver.typedefs.JSON][source]

Convert the inputs with OpenSearch request parameters considering Area-Of-Interest and Time-Of-Interest.

Parameters:
  • unique_aoi – indicate if a single/global AOI must be applied or individual ones for each input.

  • unique_toi – indicate if a single/global TOI must be applied or individual ones for each input.

weaver.processes.opensearch.get_eo_images_inputs_from_payload(payload: weaver.typedefs.JSON) List[weaver.typedefs.JSON][source]

Extracts only inputs that correspond to an EOImage based on provided additionalParameters.

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

Obtains modified WPS inputs considering mapping to known OpenSearch collection IDs.

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 from the deployed Process description.

Parameters:
  • payload

  • wps_inputs

Returns:

weaver.processes.opensearch.get_eo_images_data_sources(payload: Dict, wps_inputs: Dict[str, collections.deque[weaver.processes.convert.WPS_Input_Type]]) Dict[str, weaver.typedefs.DataSourceOpenSearch][source]

Resolve the data source of an EOImage input reference.

Parameters:
  • payload – Deploy payload

  • wps_inputs – Execute inputs

Returns:

Data source of the EOImage.

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

Get the accepted media-types from the deployment payload.

Parameters:

payload – Deploy payload.

Returns:

Accepted media-type.

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

Insert maxOccurs value in wps inputs using the deploy payload.

Parameters:
  • payload – Deploy payload.

  • wps_inputs – WPS inputs.

weaver.processes.opensearch.modified_collection_identifiers(eo_image_identifiers: List[str]) List[str][source]
weaver.processes.opensearch.get_data_source(collection_id: str) weaver.typedefs.DataSourceOpenSearch[source]

Obtain the applicable Data Source based on the provided collection identifier.

weaver.processes.opensearch.get_eo_images_ids_from_payload(payload: weaver.typedefs.JSON) List[str][source]
weaver.processes.opensearch.replace_inputs_describe_process(inputs: List[weaver.typedefs.JSON], payload: weaver.typedefs.JSON) List[weaver.typedefs.JSON][source]

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

weaver.processes.opensearch.make_param_id(param_name: str, identifier: str) str[source]

Only adds an underscore between the parameters.

weaver.processes.sources
Module Contents
weaver.processes.sources.DATA_SOURCES: weaver.typedefs.DataSourceConfig[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() weaver.typedefs.DataSourceConfig[source]
weaver.processes.sources.get_default_data_source(data_sources: weaver.typedefs.DataSourceConfig) str[source]
weaver.processes.sources.retrieve_data_source_url(data_source: str | None) str[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: str) str[source]
weaver.processes.types
Module Contents
class weaver.processes.types.ProcessType[source]

Constants container that provides similar functionalities to ExtendedEnum without explicit Enum membership.

APPLICATION = 'application'[source]
BUILTIN = 'builtin'[source]
TEST = 'test'[source]
OGC_API = 'ogcapi'[source]
WORKFLOW = 'workflow'[source]
WPS_LOCAL = 'wps'[source]
WPS_REMOTE = 'wps-remote'[source]
static is_wps(process_type: AnyProcessType) bool[source]
weaver.processes.types.AnyProcessType[source]
weaver.processes.utils
Module Contents
weaver.processes.utils.LOGGER[source]
weaver.processes.utils.UpdateFieldListMethod[source]
weaver.processes.utils.get_process(process_id: str | None = None, request: weaver.typedefs.PyramidRequest | None = None, settings: weaver.typedefs.SettingsType | None = None, store: weaver.store.base.StoreProcesses | None = None, revision: bool = True) 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.

Changed in version 4.20: Process identifier can also be an ‘id:version’ tag. Also, the request query parameter ‘version’ can be used. If using the process_id explicitly instead of the request, a versioned Process reference MUST employ the tagged representation to resolve the appropriate Process revision.

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.

Parameters:
  • process_id – Explicit Process identifier to employ for lookup.

  • request – When no explicit ID specified, try to find information from the request.

  • settings – Application settings for database connection. Can be guessed from local thread or request object if not given.

  • store – Database process store reference.

  • revision – When parsing the Process ID (either explicit or from request), indicate if any tagged revision specifier should be used or dropped.

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.get_process_information(process_description: weaver.typedefs.JSON) weaver.typedefs.JSON[source]

Obtain the details for the process within its description considering various supported formats.

weaver.processes.utils._check_deploy(payload: weaver.typedefs.JSON) weaver.typedefs.ProcessDeployment | weaver.typedefs.CWL[source]

Validate minimum deploy payload field requirements with exception handling.

weaver.processes.utils._validate_deploy_process_info(process_info: weaver.typedefs.JSON, reference: str | None, package: weaver.typedefs.CWL | None, settings: weaver.typedefs.SettingsType, headers: weaver.typedefs.AnyHeadersContainer | None) weaver.typedefs.JSON[source]

Obtain the process definition from deploy payload with exception handling.

weaver.processes.utils.resolve_cwl_graph(package: weaver.typedefs.CWL) weaver.typedefs.CWL[source]
weaver.processes.utils.deploy_process_from_payload(payload: weaver.typedefs.JSON | str, container: weaver.typedefs.AnySettingsContainer | weaver.typedefs.AnyRequestType, overwrite: bool | weaver.datatype.Process = False) pyramid.httpexceptions.HTTPException[source]

Deploy the process after resolution of all references and validation of the parameters from payload definition.

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. If it is a request-like object, additional parameters may be used to identify the payload schema.

  • overwrite – In case of a pure deployment (from scratch), indicates (using bool) whether to allow override of an existing process definition if conflict occurs. No versioning is applied in this case (full replacement). In case of an update deployment (from previous), indicates which process to be replaced with updated version. The new version should not conflict with another existing process version. If payload doesn’t provide a new version, the following MAJOR version from the specified overwrite process is used to define the new revision.

Returns:

HTTPOk if the process registration was successful.

Raises:

HTTPException – for any invalid process deployment step.

weaver.processes.utils._save_deploy_process(process: weaver.datatype.Process, override: bool, container: weaver.typedefs.AnySettingsContainer) weaver.typedefs.JSON[source]

Store the Process to database with error handling and appropriate message reporting the problem.

weaver.processes.utils._update_deploy_process_version(process: weaver.datatype.Process, process_overwrite: weaver.datatype.Process, update_level: weaver.utils.VersionLevel, container: weaver.typedefs.AnySettingsContainer | None = None) weaver.typedefs.JSON[source]

Handle all necessary update operations of a Process definition.

Validate that any specified version for Process deployment is valid against any other existing versions. Perform any necessary database adjustments to replace the old Process references for the creation of the updated Process to ensure all versions and links remain valid against their original references.

Parameters:
  • process – Desired new process definition.

  • process_overwrite – Old process from which update of the definition in database could be required.

  • update_level – Minimum semantic version level required for this update operation. If the new Process definition did not provide a version explicitly, this level will be used to automatically infer the following revision number based on the old Process reference.

  • container – Any container to retrieve a database connection.

Returns:

Process summary with definition retrieved from storage (saved) after all operations were applied.

Raises:

HTTPException – Relevant error is raised in the even of any erroneous process definition (old and new).

weaver.processes.utils._bump_process_version(version: weaver.typedefs.AnyVersion, update_level: weaver.utils.VersionLevel) weaver.typedefs.AnyVersion[source]

Obtain the relevant version with specified level incremented by one.

weaver.processes.utils._apply_process_metadata(process: weaver.datatype.Process, update_data: weaver.typedefs.JSON) weaver.utils.VersionLevel[source]

Apply requested changes for update of the Process.

Assumes that update data was pre-validated with appropriate schema validation to guarantee relevant typings and formats are applied for expected fields. Validation of fields metadata with their specific conditions is accomplished when attempting to apply changes.

See also

Schema sd.PatchProcessBodySchema describes specific field handling based on unspecified value, null or empty-list. Corresponding update levels required for fields are also provided in this schema definition.

Parameters:
  • process – Process to modify. Can be the latest or a previously tagged version.

  • update_data – Fields with updated data to apply to the process.

Returns:

Applicable update level based on updates to be applied.

weaver.processes.utils.update_process_metadata(request: weaver.typedefs.AnyRequestType) pyramid.httpexceptions.HTTPException[source]

Update only MINOR or PATCH level Process metadata.

Desired new version can be eiter specified explicitly in request payload, or will be guessed accordingly to detected changes to be applied.

weaver.processes.utils.parse_wps_process_config(config_entry: 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_static(service_url: str, service_name: str, service_visibility: bool, service_processes: List[str], container: weaver.typedefs.AnyRegistryContainer) None[source]

Register WPS-1 Process under a service Provider as static references.

For a given WPS provider endpoint, either iterates over all available processes under it to register them one by one, or limit itself only to those of the reduced set specified by service_processes.

The registered WPS-1 processes generate a static reference, meaning that metadata of each process as well as any other modifications to the real remote reference will not be tracked, including validation of even their actual existence, or modifications to inputs/outputs. The Application Package will only point to it assuming it remains valid.

Each of the deployed processes using static reference will be accessible directly under Weaver endpoints:

/processes/<service-name>_<process-id>

The service is NOT deployed as Provider since the processes are registered directly.

Parameters:
  • service_url – WPS-1 service location (where GetCapabilities and DescribeProcess requests can be made).

  • service_name – Identifier to employ for generating the full process identifier.

  • service_visibility – Visibility flag of the provider.

  • service_processes – process IDs under the service to be registered, or all if empty.

  • container – settings to retrieve required configuration settings.

weaver.processes.utils.register_wps_processes_dynamic(service_name: str, service_url: str, service_visibility: bool, container: weaver.typedefs.AnyRegistryContainer) None[source]

Register a WPS service provider such that processes under it are dynamically accessible on demand.

The registered WPS-1 provider generates a dynamic reference to processes under it. Only the Provider reference itself is actually registered. No Process are directly registered following this operation.

When information about the offered processes, descriptions of those processes or their execution are requested, Weaver will query the referenced Provider for details and convert the corresponding Process dynamically. This means that latest metadata of the Process, and any modification to it on the remote service will be immediately reflected on Weaver without any need to re-deploy processes.

Each of the deployed processes using dynamic reference will be accessible under Weaver endpoints:

/providers/<service-name>/processes/<process-id>

The processes are NOT deployed locally since the processes are retrieved from the Provider itself.

Parameters:
  • service_url – WPS-1 service location (where GetCapabilities and DescribeProcess requests can be made).

  • service_name – Identifier to employ for registering the provider identifier.

  • service_visibility – Visibility flag of the provider.

  • container – settings to retrieve required configuration settings.

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

Registers remote WPS providers and/or processes as specified from the configuration file.

Loads a wps_processes.yml file and registers processes under WPS-1/2 providers to the current Weaver instance as equivalent OGC API - Processes instances.

References listed under processes are registered statically (by themselves, unchanging snapshot). References listed under providers, the WPS themselves are registered, making each Process listed in their GetCapabilities available. In this case, registered processes are defined dynamically, meaning they will be fetched on the provider each time a request refers to them, keeping their definition up-to-date with the remote server.

New in version 1.14: 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. Previous behavior was to register each WPS process individually with ID [service]_[process].

Changed in version 4.19: Parameter position are inverted. If wps_processes_file_path is explicitly provided, it is used directly without considering settings. Otherwise, automatically employ the definition in setting: weaver.wps_processes_file.

See also

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

Note

Settings with an explicit empty weaver.wps_processes_file entry will be considered as nothing to load. If the entry is omitted, default location WEAVER_DEFAULT_WPS_PROCESSES_CONFIG is attempted instead.

Parameters:
  • container – Registry container to obtain database reference as well as application settings.

  • wps_processes_file_path – Override file path to employ instead of default settings definition.

weaver.processes.utils._check_package_file(cwl_file_path_or_url: str) str[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:

validated absolute path or URL of the file reference.

Raises:

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

weaver.processes.utils.is_cwl_package(package: Any) bool[source]

Perform minimal validation of a CWL package definition.

weaver.processes.utils.load_package_file(file_path: str) weaver.typedefs.CWL[source]

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

weaver.processes.utils.register_cwl_processes_from_config(container: weaver.typedefs.AnySettingsContainer) int[source]

Load multiple CWL definitions from a directory to register corresponding Process.

New in version 4.19.

Each individual CWL definition must fully describe a Process by itself. Therefore, an id must be available in the file to indicate the target deployment reference. In case of conflict, the existing database Process will be overridden to ensure file updates are applied.

Files are loaded in alphabetical order. If a Workflow needs to refer to other processes, they should be named in way that dependencies will be resolvable prior to the registration of the Workflow Process. The resolved directory to search for CWL will be traversed recursively. This, along with the name of CWL files themselves, can be used to resolve order-dependent loading cases. Only .cwl extensions are considered to avoid invalid parsing of other files that could be defined in the shared configuration directory.

Note

Settings with an explicit empty weaver.cwl_processes_dir entry will be considered as nothing to load. If the entry is omitted, default location WEAVER_CONFIG_DIR is used to search for CWL files.

Parameters:

container – Registry container to obtain database reference as well as application settings.

Returns:

Number of successfully registered processes from found CWL files.

weaver.processes.utils.pull_docker(docker_auth: weaver.datatype.DockerAuthentication, logger: logging.Logger = LOGGER) docker.client.DockerClient | None[source]

Pulls the referenced Docker image to local cache from an optionally secured registry.

If the Docker image is already available locally, simply validates it. Authentication are applied as necessary using the provided parameters.

Parameters:
  • docker_auth – Docker reference with optional authentication parameters.

  • logger – Alternative logger reference to log status messages about the operation.

Returns:

Docker client to perform further operations with the retrieved or validated image. None if failed.

weaver.processes.wps1_process
Module Contents
weaver.processes.wps1_process.LOGGER[source]
class weaver.processes.wps1_process.Wps1RemoteJobProgress[source]

Progress of a remotely monitored job process execution.

Note

Implementations can reuse same progress values or intermediate ones within the range of the relevant sections.

class weaver.processes.wps1_process.Wps1Process(provider: str, process: str, request: weaver.wps.service.WorkerRequest, update_status: weaver.typedefs.UpdateStatusPartialFunction)[source]

Common interface for WPS Process to be used for dispatching CWL jobs.

Multiple convenience methods are provided. Processes inheriting from this base should implement required abstract methods and override operations as needed.

Note

For expected operations details and their execution order, please refer to Workflow Step Operations.

See also

execute() for complete details of the operations and ordering.

format_inputs(workflow_inputs: weaver.typedefs.CWL_RuntimeInputList) weaver.typedefs.OWS_InputDataValues[source]

Convert submitted CWL workflow inputs into corresponding OWSLib.wps representation for execution.

Parameters:

workflow_inputs – mapping of input IDs and values submitted to the workflow.

Returns:

converted OWS inputs ready for submission to remote WPS process.

format_outputs(workflow_outputs: weaver.typedefs.JobOutputs) weaver.typedefs.JobOutputs[source]

Implementation dependent operations to configure expected outputs for Job execution.

This is an optional step that will simply pass down the outputs as is if no formatting is required. Otherwise, the implementing Process can override the step to reorganize workflow step outputs into the necessary format required for their dispatch() call.

prepare() None[source]

Implementation dependent operations to prepare the Process for Job execution.

This is an optional step that can be omitted entirely if not needed.

dispatch(process_inputs: weaver.typedefs.JobInputs, process_outputs: weaver.typedefs.JobOutputs) weaver.typedefs.JobExecution[source]

Implementation dependent operations to dispatch the Job execution to the remote Process.

Returns:

reference details that will be passed to monitor().

monitor(monitor_reference: weaver.typedefs.JobExecution) bool[source]

Implementation dependent operations to monitor the status of the Job execution that was dispatched.

This step should block execute() until the final status of the remote Job (failed/success) can be obtained.

Returns:

success status

get_results(monitor_reference: weaver.typedefs.JobExecution) weaver.typedefs.JobResults[source]

Implementation dependent operations to retrieve the results following a successful Job execution.

The operation should NOT fetch (stage) results, but only obtain the locations where they can be retrieved, based on the monitoring reference that was generated from the execution.

Returns:

results locations

weaver.processes.wps3_process
Module Contents
weaver.processes.wps3_process.LOGGER[source]
class weaver.processes.wps3_process.Wps3RemoteJobProgress[source]

Progress of a remotely monitored job process execution.

Note

Implementations can reuse same progress values or intermediate ones within the range of the relevant sections.

SETUP = 1[source]
PREPARE = 2[source]
DEPLOY = 3[source]
VISIBLE = 4[source]
READY = 5[source]
EXECUTION = 15[source]
MONITORING = 20[source]
STAGE_OUT = 90[source]
COMPLETED = 100[source]
class weaver.processes.wps3_process.Wps3Process(step_payload: weaver.typedefs.JSON, job_order: weaver.typedefs.CWL_RuntimeInputsMap, process: str, request: weaver.wps.service.WorkerRequest, update_status: weaver.typedefs.UpdateStatusPartialFunction)[source]

Remote or local Process with ADES capabilities, based on OGC API - Processes requests.

If a referenced remote service supports Process deployment using an Application Package, and that inputs point to a resolvable Data Source, the execution will be dispatched to that remote location. Otherwise, the Process is executed locally.

Most of the core operations are handled by OGCAPIRemoteProcessBase since request are sent to another ADES instance, or Weaver itself for Workflow steps, both of which are OGC API - Processes. Additional operations revolve around the resolution of which remote ADES to dispatch based on any detected Data Source location.

process_type = 'WPS-3'[source]
resolve_data_source(step_payload: weaver.typedefs.CWL, job_order: weaver.typedefs.CWL_RuntimeInputsMap) Tuple[str, str, weaver.typedefs.JSON][source]
get_user_auth_header() weaver.typedefs.HeadersType[source]
get_auth_headers() weaver.typedefs.AnyHeadersContainer[source]

Add specific user access headers for ADES if provided in Configuration Settings.

is_deployed()[source]
is_visible() 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(visibility)[source]
describe_process()[source]
deploy()[source]
prepare() None[source]

Implementation dependent operations to prepare the Process for Job execution.

This is an optional step that can be omitted entirely if not needed.

weaver.processes.wps_default
Module Contents
weaver.processes.wps_default.LOGGER[source]
class weaver.processes.wps_default.HelloWPS(*_: Any, **__: Any)[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(request, response)[source]
weaver.processes.wps_package

Representation of WPS process with an internal CWL package definition.

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 deployable Application Package.

Module Contents
weaver.processes.wps_package.LOGGER[source]
weaver.processes.wps_package.PACKAGE_DEFAULT_FILE_NAME = 'package'[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_PREPARATION = 9[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.PACKAGE_SCHEMA_CACHE: Dict[str, Tuple[str, str]][source]
weaver.processes.wps_package.get_status_location_log_path(status_location: str, out_dir: str | None = 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: Dict[str, Any] | str, data_source: str | None = 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: weaver.typedefs.CWL | str) List[weaver.typedefs.CWL_WorkflowStepReference][source]

Obtain references to intermediate steps of a CWL workflow.

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) weaver.typedefs.Literal[weaver.processes.types.ProcessType.APPLICATION, weaver.processes.types.ProcessType.WORKFLOW][source]
weaver.processes.wps_package._get_package_requirements_normalized(requirements: weaver.typedefs.CWL_AnyRequirements, as_dict: bool = False) weaver.typedefs.CWL_AnyRequirements[source]

Converts CWL package requirements or hints into list or dict representation.

Uniformization of CWL requirements or hints into the list representation (default) or as dict if requested, whether the input definitions where provided using the dictionary definition as {"<req-class>": {<params>}} or the list of dictionary requirements [{<req-class + params>}] each with a class key.

weaver.processes.wps_package._update_package_compatibility(package: weaver.typedefs.CWL) weaver.typedefs.CWL[source]

Update a CWL package with backward compatibility changes if applicable.

weaver.processes.wps_package._load_supported_schemas() None[source]

Loads CWL schemas supported by Weaver to avoid validation errors when provided in requirements.

Use a similar strategy as cwltool.main.setup_schema(), but skipping the CLI context and limiting loaded schema definitions to those that Weaver allows. Drops extensions that could cause misbehaving functionalities when other Process types than CWL-based Application Package are used.

This operation must be called before the CWLFactory attempts loading and validating a CWL document.

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

Loads CWL package definition using various contextual resources.

Following operations are accomplished to validate the package:

  • Starts by resolving any intermediate sub-packages steps if the parent package is a Workflow in order to recursively generate and validate their process and package, potentially using remote reference. Each of the following operations are applied to every step individually.

  • Package I/O are reordered using any reference process offering hints if provided to generate consistent results.

  • Perform backward compatibility checks and conversions to the package if applicable.

  • The resulting package definition is dumped to a temporary JSON file, to validate the content can be serialized.

  • Optionally, the CWL factory is employed to create the application runner, validating any provided loading and runtime contexts, and considering all resolved Workflow steps if applicable, or the atomic application otherwise.

Parameters:
  • package_dict – Package content representation as a dictionary.

  • package_name – Name to use to create the package file and CWL identifiers.

  • 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_contextcwltool context used to create the CWL package.

  • runtime_contextcwltool context used to execute the CWL package.

  • process_offeringJSON body of the process description payload (used as I/O hint ordering).

Returns:

If only_dump_file is True, returns None. Otherwise, tuple of:

  • Instance of CWLFactoryCallable

  • Package type (ProcessType.WORKFLOW or ProcessType.APPLICATION)

  • Package sub-steps definitions if package represents a ProcessType.WORKFLOW. Otherwise, empty mapping. Mapping of each step name contains their respective package ID and CWL definition that must be run.

Warning

Specified tmp_dir will be deleted on exit.

weaver.processes.wps_package._merge_package_inputs_outputs(wps_inputs_defs: List[weaver.processes.convert.ANY_IO_Type] | Dict[str, weaver.processes.convert.ANY_IO_Type], cwl_inputs_list: List[weaver.processes.convert.WPS_Input_Type], wps_outputs_defs: List[weaver.processes.convert.ANY_IO_Type] | Dict[str, 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 corresponding metadata of I/O definitions from CWL and WPS sources.

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 (i.e.: CWL I/O converted to corresponding WPS I/O objects).

See also

Conversion of CWL to WPS-equivalent objects is handled by _get_package_inputs_outputs() and its underlying functions.

Parameters:
  • wps_inputs_defs – list or mapping of provided WPS input definitions.

  • cwl_inputs_list – processed list of CWL inputs from the Application Package.

  • wps_outputs_defs – list or mapping of provided WPS output definitions.

  • cwl_outputs_list – processed list of CWL inputs from the Application Package.

Returns:

Tuple of (inputs, outputs) consisting of lists of I/O with merged contents between CWL and WPS.

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

Retrieves I/O definitions from a validated CWLFactoryCallable.

See also

Factory can be obtained with validation using _load_package_content().

Parameters:
  • package_factoryCWL factory that contains I/O references to the package definition.

  • io_select – either IO_INPUT or IO_OUTPUT according to what needs to be processed.

  • as_json – toggle to the desired output type. If True, converts the I/O definitions into JSON representation. If False, converts the I/O definitions into WPS objects.

Returns:

I/O format depending 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._patch_wps_process_description_url(reference: str, process_hint: weaver.typedefs.JSON | None) str[source]

Rebuilds a WPS ProcessDescription URL from other details.

A GetCapabilities request can be submitted with an ID in query params directly. Otherwise, check if a process hint can provide the ID.

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

Resolves the reference type representing a remote Process and generates a CWL package for it.

The reference can point to any definition amongst below known structures: - CWL - WPS-1/2 - WPS-REST - OGC API - Processes

Additionally, provides minimal Process details retrieved from the reference. The number of details obtained will depend on available parameters from its description as well as the number of metadata that can be mapped between it and the generated CWL package.

The resulting Process and its CWL will correspond to a remote instance to which execution should be dispatched and monitored, except if the reference was directly a CWL file.

Warning

Only conversion of the reference into a potential CWL definition is accomplished by this function. Further validations must still be applied to ensure the loaded definition is valid and meets all requirements.

weaver.processes.wps_package.get_application_requirement(package: weaver.typedefs.CWL, search: weaver.typedefs.CWL_RequirementNames | None = None, default: weaver.typedefs.CWL_Requirement | weaver.typedefs.Default | None = null, validate: bool = True, required: bool = True) weaver.typedefs.CWL_Requirement | weaver.typedefs.Default[source]

Retrieves a requirement or hint from the CWL package definition.

If no search filter is specified (default), retrieve the principal requirement that allows mapping to the appropriate Process implementation. The principal requirement can be extracted for an Application Package of type ProcessType.APPLICATION because only one is permitted simultaneously amongst CWL_REQUIREMENT_APP_TYPES. If the CWL is not of type ProcessType.APPLICATION, the requirement check is skipped regardless of required.

If a search filter is provided, this specific requirement or hint is looked for instead. Regardless of the applied filter, only a unique item can be matched across requirements/hints mapping and/or listing representations.

When validate is enabled, all requirements and hints must also be defined within CWL_REQUIREMENTS_SUPPORTED for the CWL package to be considered valid.

When convert is enabled, any backward compatibility definitions will be converted to their corresponding definition.

Parameters:
  • package – CWL definition to parse.

  • search – Specific requirement/hint name to search and retrieve the definition if available.

  • default – Default value to return if no match was found. If None, returns an empty {"class": ""}.

  • validate – Validate supported requirements/hints definition while extracting requested one.

  • required – Validation will fail if no supported requirements/hints definition could be found.

Returns:

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

weaver.processes.wps_package.check_package_instance_compatible(package: weaver.typedefs.CWL) str | None[source]

Verifies if an Application Package definition is valid for the employed Weaver instance configuration.

Given that the CWL is invalid for the active application, explains the reason why that package always require remote execution.

When a package can sometimes be executed locally (ADES) or remotely (EMS) depending on the instance configuration, such as in the case of a CWL_REQUIREMENT_APP_DOCKER, return None. This function instead detects cases where a remote server is mandatory without ambiguity related to the current Weaver instance, regardless whether remote should be an ADES or a remote Provider (WPS or ESGF-CWT).

Parameters:

package – CWL definition for the process.

Returns:

reason message if it must be executed remotely or None if it could be executed locally.

weaver.processes.wps_package.get_auth_requirements(requirement: weaver.typedefs.JSON, headers: weaver.typedefs.AnyHeadersContainer | None) weaver.datatype.Authentication | None[source]

Extract any authentication related definitions provided in request headers corresponding to the application type.

Parameters:
  • requirementApplication Package requirement as defined by CWL requirements.

  • headers – Requests headers received during deployment.

Returns:

Matched authentication details when applicable, otherwise None.

Raises:
  • TypeError – When the authentication object cannot be created due to invalid or missing inputs.

  • ValueError – When the authentication object cannot be created due to incorrectly formed inputs.

weaver.processes.wps_package.get_process_identifier(process_info: weaver.typedefs.JSON, package: weaver.typedefs.CWL) str[source]

Obtain a sane name identifier reference from the Process or the Application Package.

weaver.processes.wps_package.get_process_definition(process_offering: weaver.typedefs.JSON, reference: str | None = None, package: weaver.typedefs.CWL | None = None, data_source: str | None = None, headers: weaver.typedefs.AnyHeadersContainer | None = None, builtin: bool = False) weaver.typedefs.JSON[source]

Resolve the process definition considering corresponding metadata from the offering, package and references.

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, 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).

  • headers – Request headers provided during deployment to retrieve details such as authentication tokens.

  • builtin – Indicate if the package is expected to be a CWL_REQUIREMENT_APP_BUILTIN definition.

Returns:

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

class weaver.processes.wps_package.DirectoryNestedStorage(storage: pywps.inout.storage.file.FileStorage | pywps.inout.storage.s3.S3Storage)[source]

Generates a nested storage for a directory where each contained file will be managed by the storage.

Initializes the storage.

Parameters:

storage – Storage implementation that is employed for storing files in a directory-like structure.

property type: pywps.inout.storage.STORE_TYPE[source]
_patch_destination(destination: str) str[source]
_do_store(output: pywps.inout.outputs.ComplexOutput) Tuple[pywps.inout.storage.STORE_TYPE, weaver.typedefs.Path, str][source]

Store all files contained in a directory recursively.

Note

This is called from CachedStorage.store() only if not already in storage using cached output ID.

write(data: AnyStr, destination: str, data_format: pywps.inout.formats.Format | None = None) str[source]

Write data representing the directory itself or dispatch call to base storage for any other file contents.

When the directory itself is targeted, upload an empty bucket object for S3 base storage, or makes the directory structure for base file storage.

url(destination: str) str[source]
Parameters:

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

Returns:

URL where file_name can be reached

location(destination: str) weaver.typedefs.Path[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

class weaver.processes.wps_package.WpsPackage(package: weaver.typedefs.CWL = None, payload: weaver.typedefs.JSON | None = None, **kw: Any)[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()

property status_filename: str[source]

Obtain the XML status location of this process when executed.

The status location applies the WPS-Output-Context if defined such that any following output or log file references that derive from it will be automatically stored in the same nested context.

property job: weaver.datatype.Job[source]

Obtain the job associated to this package execution as specified by the provided UUID.

Process must be in “execute” state under pywps for this job to be available.

property auth: weaver.typedefs.AnyHeadersContainer[source]
setup_loggers(log_stdout_stderr: bool = True) None[source]

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

insert_package_log(result: weaver.typedefs.CWL_Results | cwltool.factory.WorkflowStatus) 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

setup_docker_image() bool | None[source]

Pre-pull the Docker image locally for running the process if authentication is required to get it.

Returns:

success status if operation was successful, or None when it does not apply.

setup_runtime() Dict[str, weaver.typedefs.AnyValueType][source]

Prepares the runtime parameters for the CWL package execution.

Parameter weaver.wps_workdir is the base-dir where sub-dir per application packages will be generated. Parameter workdir is the actual location PyWPS reserved for this process (already with sub-dir). If no weaver.wps_workdir was provided, reuse PyWps parent workdir since we got access to it. Other steps handling outputs need to consider that CWL<->WPS out dirs could match because of this.

Returns:

resolved runtime parameters

update_requirements() None[source]

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

update_cwl_schema_names() None[source]

Detect duplicate CWL schema types not referred by name to provide one and avoid resolution failure.

Doing this resolution avoids reused definitions being considered as “conflicts” because of missing name. To avoid introducing a real conflict, names are injected only under corresponding CWL I/O by ID. The most common type of definition resolve this way is when CWL Enum is reused for single and array-based definitions simultaneously.

update_effective_user() None[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(message: str, progress: weaver.typedefs.Number, status: weaver.status.AnyStatusType, error: Exception | None = None) None[source]

Updates the pywps real job status from a specified parameters.

step_update_status(message: str, progress: weaver.typedefs.Number, start_step_progress: weaver.typedefs.Number, end_step_progress: weaver.typedefs.Number, step_name: str, target_host: str, status: weaver.status.AnyStatusType, error: Exception | None = None) None[source]
log_message(status: weaver.status.AnyStatusType, message: str, progress: weaver.typedefs.Number | None = None, level: int = logging.INFO) None[source]
exception_message(exception_type: Type[Exception], exception: Exception | None = None, message: str = 'no message', status: weaver.status.AnyStatusType = Status.EXCEPTION, progress: weaver.typedefs.Number | None = None, level: int = 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(step_index: int, steps_total: int) 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(request: weaver.wps.service.WorkerRequest, response: pywps.response.execute.ExecuteResponse) pywps.response.execute.ExecuteResponse[source]

Method called when process receives the WPS execution request.

must_fetch(input_ref: str, input_type: weaver.processes.constants.PACKAGE_COMPLEX_TYPES) 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(wps_inputs: Dict[str, Deque[weaver.processes.convert.WPS_Input_Type]], cwl_inputs_info: Dict[str, weaver.typedefs.CWL_Input_Type], cwl_schema_names: weaver.typedefs.CWL_SchemaNames) Dict[str, weaver.typedefs.ValueType][source]

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

The WPS inputs must correspond to pywps definitions. Multiple values (repeated objects with corresponding IDs) are adapted to arrays as needed. All WPS Complex types 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.

  • cwl_schema_names – Mapping of CWL type schema references to resolve ‘type: <ref>’ if used in a definition.

Returns:

CWL input values.

static make_literal_input(input_definition: pywps.inout.inputs.LiteralInput) weaver.typedefs.JSON[source]

Converts Literal Data representations to compatible CWL contents with JSON encodable values.

static make_location_bbox(input_definition: pywps.inout.inputs.BoundingBoxInput) None[source]

Convert a Bounding Box to a compatible CWL File using corresponding IOHandler of a Complex input.

make_location_input_security_check(input_scheme: str, input_type: weaver.typedefs.CWL_IO_ComplexType, input_id: str, input_location: str, input_definition: pywps.inout.inputs.ComplexInput) str[source]

Perform security access validation of the reference, and resolve it afterwards if accessible.

Auto-map local file if possible to avoid useless download from current server. Resolve Vault reference with local file stored after decryption.

Returns:

Updated file location if any resolution occurred.

make_location_input(input_type: weaver.typedefs.CWL_IO_ComplexType, input_definition: pywps.inout.inputs.ComplexInput | pywps.inout.inputs.BoundingBoxInput) weaver.typedefs.JSON | None[source]

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

If the input reference corresponds to an HTTP URL that is detected as matching the local WPS output endpoint, implicitly convert the reference to the local WPS output directory to avoid useless download of available file. Since that endpoint could be protected though, perform a minimal HEAD request to validate its accessibility. Otherwise, this operation could incorrectly grant unauthorized access to protected files by forging the URL.

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

Any other variant of file reference will be fetched as applicable by the relevant schemes.

If the reference corresponds to a Directory, all files that can be located in it will be fetched as applicable by the relevant scheme of the reference. It is up to the remote location to provide listing capabilities accordingly to view available files.

See also

Documentation details of resolution based on schemes defined in File Reference Types section.

make_outputs(cwl_result: weaver.typedefs.CWL_Results) None[source]

Maps CWL result outputs to corresponding WPS outputs.

static make_literal_output(data: weaver.typedefs.AnyValueType) weaver.typedefs.AnyValueType[source]

Converts Literal Data representations to compatible CWL contents with JSON encodable values.

make_bbox_output(cwl_result: weaver.typedefs.CWL_Results, output_id: str) None[source]

Generates the WPS Bounding Box output from the CWL File.

Assumes that location outputs were resolved beforehand, such that the file is available locally.

make_location_output(cwl_result: weaver.typedefs.CWL_Results, output_id: str) 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()

static resolve_output_format(output: pywps.inout.outputs.ComplexOutput, result_path: str, result_cwl_format: str | None) None[source]

Resolves the obtained media-type for an output CWL File.

Considers CWL results format, the file path, and the Process description to resolve the best possible match, retaining a much as possible the metadata that can be resolved from their corresponding details.

make_location_storage(storage_type: pywps.inout.storage.STORE_TYPE, location_type: weaver.processes.constants.PACKAGE_COMPLEX_TYPES) pywps.inout.storage.file.FileStorage | pywps.inout.storage.s3.S3Storage | DirectoryNestedStorage[source]

Generates the relevant storage implementation with requested types and references.

Parameters:
  • storage_type – Where to store the outputs.

  • location_type – Type of output as defined by CWL package type.

Returns:

Storage implementation.

make_tool(toolpath_object: weaver.typedefs.CWL_ToolPathObject, loading_context: cwltool.context.LoadingContext) cwltool.process.Process[source]
get_workflow_step_package(job_name: str) weaver.typedefs.CWL_WorkflowStepPackage[source]

Resolve the step CWL definition under a Workflow.

get_job_process_definition(job_name: str, job_order: weaver.typedefs.JSON, tool: weaver.typedefs.CWL) WpsPackage[source]

Obtain the execution job definition for the given process (Workflow step implementation).

This function is called before running an ADES Job (either from a workflow step or simple EMS Job dispatching).

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:
  • job_name – The workflow step or the package id that must be launched on an ADES string

  • job_order – 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 and requirements (see: weaver.processes.constants.CWL_REQUIREMENT_APP_TYPES)

weaver.processes.wps_process_base
Module Contents
weaver.processes.wps_process_base.LOGGER[source]
class weaver.processes.wps_process_base.RemoteJobProgress[source]

Progress of a remotely monitored job process execution.

Note

Implementations can reuse same progress values or intermediate ones within the range of the relevant sections.

SETUP = 1[source]
PREPARE = 2[source]
READY = 5[source]
STAGE_IN = 10[source]
FORMAT_IO = 12[source]
EXECUTION = 15[source]
MONITORING = 20[source]
RESULTS = 85[source]
STAGE_OUT = 90[source]
CLEANUP = 95[source]
COMPLETED = 100[source]
class weaver.processes.wps_process_base.WpsProcessInterface(request: weaver.wps.service.WorkerRequest, update_status: weaver.typedefs.UpdateStatusPartialFunction)[source]

Common interface for WPS Process to be used for dispatching CWL jobs.

Multiple convenience methods are provided. Processes inheriting from this base should implement required abstract methods and override operations as needed.

Note

For expected operations details and their execution order, please refer to Workflow Step Operations.

See also

execute() for complete details of the operations and ordering.

execute(workflow_inputs: weaver.typedefs.CWL_RuntimeInputsMap, out_dir: str, expected_outputs: weaver.typedefs.CWL_ExpectedOutputs) None[source]

Execute the core operation of the 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’}

prepare() None[source]

Implementation dependent operations to prepare the Process for Job execution.

This is an optional step that can be omitted entirely if not needed.

format_inputs(workflow_inputs: weaver.typedefs.JobInputs) weaver.typedefs.JobInputs | Any[source]

Implementation dependent operations to configure input values for Job execution.

This is an optional step that will simply pass down the inputs as is if no formatting is required. Otherwise, the implementing Process can override the step to reorganize workflow step inputs into the necessary format required for their dispatch() call.

format_outputs(workflow_outputs: weaver.typedefs.JobOutputs) weaver.typedefs.JobOutputs[source]

Implementation dependent operations to configure expected outputs for Job execution.

This is an optional step that will simply pass down the outputs as is if no formatting is required. Otherwise, the implementing Process can override the step to reorganize workflow step outputs into the necessary format required for their dispatch() call.

abstract dispatch(process_inputs: weaver.typedefs.JobInputs, process_outputs: weaver.typedefs.JobOutputs) weaver.typedefs.JobMonitorReference[source]

Implementation dependent operations to dispatch the Job execution to the remote Process.

Returns:

reference details that will be passed to monitor().

abstract monitor(monitor_reference: weaver.typedefs.JobMonitorReference) bool[source]

Implementation dependent operations to monitor the status of the Job execution that was dispatched.

This step should block execute() until the final status of the remote Job (failed/success) can be obtained.

Returns:

success status

abstract get_results(monitor_reference: weaver.typedefs.JobMonitorReference) weaver.typedefs.JobResults[source]

Implementation dependent operations to retrieve the results following a successful Job execution.

The operation should NOT fetch (stage) results, but only obtain the locations where they can be retrieved, based on the monitoring reference that was generated from the execution.

Returns:

results locations

cleanup() None[source]

Implementation dependent operations to clean the Process or Job execution.

This is an optional step that doesn’t require any override if not needed by derived classes.

get_auth_headers() weaver.typedefs.AnyHeadersContainer[source]

Implementation dependent operation to retrieve applicable authorization headers.

This method is employed for every make_request() call to avoid manually providing them each time. Any overriding method should consider calling this method to retrieve authorization headers from WPS request.

get_auth_cookies() weaver.typedefs.CookiesTupleType[source]

Implementation dependent operation to retrieve applicable authorization cookies.

This method is employed for every make_request() call to avoid manually providing them each time. Any overriding method should consider calling this method to retrieve authorization cookies from WPS request.

make_request(method: str, url: str, retry: bool | int = False, cookies: weaver.typedefs.AnyCookiesContainer | None = None, headers: weaver.typedefs.AnyHeadersContainer | None = None, **kwargs) weaver.typedefs.AnyResponseType[source]

Sends the request with additional parameter handling for the current process definition.

host_reference(reference: str) str[source]

Hosts an intermediate reference between Workflow steps for processes that require remote access.

Parameters:

reference – Intermediate file or directory location (local path expected).

Returns:

Hosted temporary HTTP file or directory location.

stage_results(results: weaver.typedefs.JobResults, expected_outputs: weaver.typedefs.CWL_ExpectedOutputs, out_dir: str) None[source]

Retrieves the remote execution Job results for staging locally into the specified output directory.

This operation should be called by the implementing remote Process definition after execute().

Note

The CWL runner expects the output file(s) to be written matching definition in expected_outputs, but this definition could be a glob pattern to match multiple file and/or nested directories. We cannot rely on specific file names to be mapped, since glob can match many (eg: "*.txt").

See also

Function weaver.processes.convert._convert_any2cwl_io_complex() defines a generic glob pattern from the expected file extension based on Content-Type format. Since the remote WPS Process doesn’t necessarily produce file names with the output ID as expected to find them (could be anything), staging must patch locations to let CWL runtime resolve the files according to glob definitions.

stage_inputs(workflow_inputs: weaver.typedefs.CWL_WorkflowInputs) weaver.typedefs.JobInputs[source]

Retrieves inputs for local staging if required for the following Job execution.

class weaver.processes.wps_process_base.OGCAPIRemoteProcessBase(step_payload: weaver.typedefs.JSON, process: str, request: weaver.wps.service.WorkerRequest, update_status: weaver.typedefs.UpdateStatusPartialFunction)[source]

Common interface for WPS Process to be used for dispatching CWL jobs.

Multiple convenience methods are provided. Processes inheriting from this base should implement required abstract methods and override operations as needed.

Note

For expected operations details and their execution order, please refer to Workflow Step Operations.

See also

execute() for complete details of the operations and ordering.

process_type: str[source]
provider: str[source]
url: str[source]
format_outputs(workflow_outputs: weaver.typedefs.JobOutputs) weaver.typedefs.JobOutputs[source]

Implementation dependent operations to configure expected outputs for Job execution.

This is an optional step that will simply pass down the outputs as is if no formatting is required. Otherwise, the implementing Process can override the step to reorganize workflow step outputs into the necessary format required for their dispatch() call.

dispatch(process_inputs: weaver.typedefs.JobInputs, process_outputs: weaver.typedefs.JobOutputs) str[source]

Implementation dependent operations to dispatch the Job execution to the remote Process.

Returns:

reference details that will be passed to monitor().

monitor(monitor_reference: str) bool[source]

Implementation dependent operations to monitor the status of the Job execution that was dispatched.

This step should block execute() until the final status of the remote Job (failed/success) can be obtained.

Returns:

success status

get_job_status(job_status_uri: weaver.typedefs.JobMonitorReference, retry: bool | int = True) weaver.typedefs.JSON[source]

Obtains the contents from the Job status response.

get_results(monitor_reference: str) weaver.typedefs.JobResults[source]

Obtains produced output results from successful job status ID.

weaver.processes.wps_testing
Module Contents
class weaver.processes.wps_testing.WpsTestProcess(inputs: List[weaver.processes.wps_package.ANY_IO_Type] | None = None, outputs: List[weaver.processes.wps_package.ANY_IO_Type] | None = None, **kw: str)[source]

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

Initialize the test process with minimal definition requirements.

If no inputs/outputs are provided, a default literal string is applied for both. Otherwise, test_input and test_output of the desired type and format should be explicitly provided to allow successful execution. Other I/O can be specified, but they will be ignored.

type[source]
_handler(request, response)[source]
weaver.processes.wps_workflow
Module Contents
weaver.processes.wps_workflow.MonitorFunction[source]
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.CWL_ToolPathObject, loading_context: cwltool.context.LoadingContext, get_job_process_definition: weaver.typedefs.JobProcessDefinitionCallback) cwltool.process.Process[source]

Generate the tool class object from the CWL definition to handle its execution.

Warning

Package cwltool introduces explicit typing definitions with mypy_extensions. This can cause TypeError("interpreted classes cannot inherit from compiled") when using cwltool.process.Process as base class for our custom definitions below. To avoid the error, we must enforce the type using cast().

class weaver.processes.wps_workflow.WpsWorkflow(toolpath_object: weaver.typedefs.CWL_ToolPathObject, loading_context: cwltool.context.LoadingContext, get_job_process_definition: weaver.typedefs.JobProcessDefinitionCallback)[source]

Definition of a CWL workflow that can execute WPS application packages as intermediate job steps.

Steps are expected to be defined as individual weaver.processes.wps_package.WpsPackage references.

Initialize this CommandLineTool.

job(job_order: cwltool.utils.CWLObjectType, output_callbacks: Callable[[Any, Any], Any], runtime_context: cwltool.context.RuntimeContext) cwltool.utils.JobsGeneratorType[source]

Workflow job generator.

Parameters:
  • job_order – 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(schema: cwltool.utils.CWLObjectType, builder: cwltool.builder.Builder, outdir: str, fs_access: cwltool.stdfsaccess.StdFsAccess, compute_checksum: bool = True) cwltool.utils.CWLOutputType | None[source]

Collect outputs from the step Process following its execution.

Note

Because the staging operation following remote Process execution nests each output under a directory name matching respective output IDs, globs must be update with that modified nested directory as well.

class weaver.processes.wps_workflow.WpsWorkflowJob(builder: cwltool.builder.Builder, job_order: cwltool.utils.CWLObjectType, make_path_mapper: Callable[Ellipsis, cwltool.pathmapper.PathMapper], requirements: weaver.typedefs.CWL_RequirementsList, hints: weaver.typedefs.CWL_RequirementsList, name: str, wps_process: weaver.processes.wps_process_base.WpsProcessInterface, expected_outputs: List[weaver.typedefs.CWL_Output_Type])[source]

Base class for get_requirement().

Initialize the job object.

_execute(runtime: List[str], env: MutableMapping[str, str], runtime_context: cwltool.context.RuntimeContext, monitor_function: MonitorFunction = None) None[source]

Execute the WPS Process defined as Workflow step and chains their intermediate results.

Package Contents
weaver.processes.includeme(config: pyramid.config.Configurator) None[source]
weaver.quotation
Submodules
weaver.quotation.estimation
Module Contents
weaver.quotation.estimation.EstimatorInputLiteral[source]
weaver.quotation.estimation.LOGGER[source]
class weaver.quotation.estimation.CurrencyConverter(name: str, url: str, parser: Callable[[weaver.typedefs.JSON | str], weaver.typedefs.Number], **kwargs: Any)[source]

Generic definition of a currency converter.

url: str[source]
name: str[source]
token: str = ''[source]
json: bool = True[source]
parser: Callable[[weaver.typedefs.JSON | str], weaver.typedefs.Number | str][source]
convert(currency: weaver.typedefs.Number | decimal.Decimal, from_currency: str, to_currency: str) decimal.Decimal[source]
weaver.quotation.estimation.CURRENCY_CONVERTERS: Dict[str, CurrencyConverter][source]
weaver.quotation.estimation.get_quote_estimator_config(process: weaver.datatype.Process, ignore_error: bool = False) weaver.typedefs.JSON[source]

Obtain the estimator from the process after validation.

weaver.quotation.estimation.validate_quote_estimator_config(estimator: weaver.typedefs.JSON) weaver.typedefs.JSON[source]

Validate a quote estimator configuration against the expected schema.

weaver.quotation.estimation.prepare_quote_estimator_config(quote: weaver.datatype.Quote, process: weaver.datatype.Process) weaver.typedefs.JSON[source]

Retrieves submitted quote input parameters and prepares them for the estimation using the process configuration.

All submitted inputs are made available to the estimator(s). It is up to them to employ relevant inputs based on the quote estimation configuration applicable for this process.

According to the quote-estimator schema, complex inputs must provide the file size, while literals provide the values directly. Weights are retrieved from the process configuration, but must be joined along inputs definition.

weaver.quotation.estimation.get_currency(request: weaver.typedefs.AnyRequestType) str[source]
weaver.quotation.estimation.request_convert_cost(method: weaver.typedefs.AnyRequestMethod, url: str, kwargs: weaver.utils.RequestCachingKeywords) requests.Response[source]
weaver.quotation.estimation.convert_exchange_rate(amount: decimal.Decimal, convert_currency: str, original_currency: str | None = None) weaver.typedefs.Price[source]

Convert the cost value using the requested currency.

weaver.quotation.estimation.estimate_process_quote(quote: weaver.datatype.Quote, process: weaver.datatype.Process, settings: weaver.typedefs.AnySettingsContainer | None = None) weaver.datatype.Quote[source]

Estimate execution price and time for an atomic Process operation.

Employs provided inputs and expected outputs and relevant metadata for the Process.

Parameters:
  • quote – Quote with references to process parameters.

  • process – Targeted process for execution.

  • settings – Application settings.

Returns:

Updated quote with estimates.

weaver.quotation.estimation.estimate_workflow_quote(quote: weaver.datatype.Quote, process: weaver.datatype.Process, settings: weaver.typedefs.AnySettingsContainer | None = None) weaver.datatype.Quote[source]

Loop Workflow sub-Process steps to get their respective Quote.

weaver.quotation.estimation.execute_quote_estimator(task: celery.app.task.Task, quote_id: weaver.typedefs.AnyUUID) weaver.quotation.status.AnyQuoteStatus[source]

Estimate Quote parameters for the Process execution.

Parameters:
  • task – Celery Task that processes this quote.

  • quote_id – Quote identifier associated to the requested estimation for the process execution.

Returns:

Estimated quote parameters.

weaver.quotation.status
Module Contents
class weaver.quotation.status.QuoteStatus[source]

Constants container that provides similar functionalities to ExtendedEnum without explicit Enum membership.

SUBMITTED = 'submitted'[source]
PROCESSING = 'processing'[source]
COMPLETED = 'completed'[source]
FAILED = 'failed'[source]
weaver.quotation.status.AnyQuoteStatus[source]
Package Contents
weaver.quotation.includeme(config: pyramid.config.Configurator) None[source]
weaver.store
Submodules
weaver.store.base
Module Contents
weaver.store.base.JobGroupCategory[source]
weaver.store.base.StoreServicesType[source]
weaver.store.base.StoreProcessesType[source]
weaver.store.base.StoreJobsType[source]
weaver.store.base.StoreBillsType[source]
weaver.store.base.StoreQuotesType[source]
weaver.store.base.StoreVaultType[source]
weaver.store.base.StoreTypeName[source]
class weaver.store.base.StoreInterface(settings: weaver.typedefs.SettingsType | None = None)[source]
type: StoreTypeName[source]
settings: weaver.typedefs.SettingsType[source]
class weaver.store.base.StoreServices(settings: weaver.typedefs.SettingsType | None = None)[source]
type[source]
abstract save_service(service: weaver.datatype.Service, overwrite: bool = True) weaver.datatype.Service[source]
abstract delete_service(name: str) bool[source]
abstract list_services() List[weaver.datatype.Service][source]
abstract fetch_by_name(name: str, visibility: weaver.visibility.AnyVisibility | None = None) weaver.datatype.Service[source]
abstract fetch_by_url(url: str) weaver.datatype.Service[source]
abstract clear_services() bool[source]
class weaver.store.base.StoreProcesses(settings: weaver.typedefs.SettingsType | None = None)[source]
type[source]
abstract save_process(process: weaver.datatype.Process | pywps.Process, overwrite: bool = True) weaver.datatype.Process[source]
abstract delete_process(process_id: weaver.typedefs.AnyProcessRef, visibility: weaver.visibility.AnyVisibility | None = None) bool[source]
abstract list_processes(visibility: weaver.visibility.AnyVisibility | List[weaver.visibility.AnyVisibility] | None = None, page: int | None = None, limit: int | None = None, sort: weaver.sort.AnySortType | None = None, total: bool = False, revisions: bool = False, process: str | None = None) List[weaver.datatype.Process] | Tuple[List[weaver.datatype.Process], int][source]
abstract fetch_by_id(process_id: weaver.typedefs.AnyProcessRef, visibility: weaver.visibility.AnyVisibility | None = None) weaver.datatype.Process[source]
abstract find_versions(process_id: weaver.typedefs.AnyProcessRef, version_format: weaver.utils.VersionFormat = VersionFormat.OBJECT) List[weaver.typedefs.AnyVersion][source]
abstract update_version(process_id: weaver.typedefs.AnyProcessRef, version: weaver.typedefs.AnyVersion) weaver.datatype.Process[source]
abstract get_estimator(process_id: weaver.typedefs.AnyProcessRef) weaver.typedefs.JSON[source]
abstract set_estimator(process_id: weaver.typedefs.AnyProcessRef, estimator: weaver.typedefs.JSON) None[source]
abstract get_visibility(process_id: weaver.typedefs.AnyProcessRef) weaver.visibility.AnyVisibility[source]
abstract set_visibility(process_id: weaver.typedefs.AnyProcessRef, visibility: weaver.visibility.AnyVisibility) None[source]
abstract clear_processes() bool[source]
class weaver.store.base.StoreJobs(settings: weaver.typedefs.SettingsType | None = None)[source]
type[source]
abstract save_job(task_id: str, process: weaver.typedefs.AnyProcessRef, service: weaver.typedefs.AnyServiceRef | None = None, inputs: weaver.typedefs.ExecutionInputs | None = None, outputs: weaver.typedefs.ExecutionOutputs | None = None, is_workflow: bool = False, is_local: bool = False, execute_async: bool = True, execute_response: weaver.execute.AnyExecuteResponse | None = None, custom_tags: List[str] | None = None, user_id: int | None = None, access: weaver.visibility.AnyVisibility | None = None, context: str | None = None, subscribers: weaver.typedefs.ExecutionSubscribers | None = None, accept_language: str | None = None, created: datetime.datetime | None = None) weaver.datatype.Job[source]
abstract batch_update_jobs(job_filter: Dict[str, Any], job_update: Dict[str, Any]) int[source]
abstract update_job(job: weaver.datatype.Job) weaver.datatype.Job[source]
abstract delete_job(job_id: weaver.typedefs.AnyUUID) bool[source]
abstract fetch_by_id(job_id: weaver.typedefs.AnyUUID) weaver.datatype.Job[source]
abstract list_jobs() List[weaver.datatype.Job][source]
abstract find_jobs(process: str | None = None, service: str | None = None, job_type: str | None = None, tags: List[str] | None = None, access: str | None = None, status: weaver.status.AnyStatusSearch | List[weaver.status.AnyStatusSearch] | None = None, sort: weaver.sort.AnySortType | None = None, page: int | None = 0, limit: int | None = 10, min_duration: int | None = None, max_duration: int | None = None, datetime_interval: weaver.typedefs.DatetimeIntervalType | None = None, group_by: str | List[str] | None = None, request: pyramid.request.Request | None = None) JobSearchResult[source]
abstract clear_jobs() bool[source]
class weaver.store.base.StoreQuotes(settings: weaver.typedefs.SettingsType | None = None)[source]
type[source]
abstract save_quote(quote: weaver.datatype.Quote) weaver.datatype.Quote[source]
abstract fetch_by_id(quote_id: weaver.typedefs.AnyUUID) weaver.datatype.Quote[source]
abstract list_quotes() List[weaver.datatype.Quote][source]
abstract find_quotes(process_id: str | None = None, page: int = 0, limit: int = 10, sort: weaver.sort.AnySortType | None = None) Tuple[List[weaver.datatype.Quote], int][source]
abstract update_quote(quote: weaver.datatype.Quote) weaver.datatype.Quote[source]
class weaver.store.base.StoreBills(settings: weaver.typedefs.SettingsType | None = None)[source]
type[source]
abstract save_bill(bill: weaver.datatype.Bill) weaver.datatype.Bill[source]
abstract fetch_by_id(bill_id: weaver.typedefs.AnyUUID) weaver.datatype.Bill[source]
abstract list_bills() List[weaver.datatype.Bill][source]
abstract find_bills(quote_id: str | None = None, page: int = 0, limit: int = 10, sort: weaver.sort.AnySortType | None = None) Tuple[List[weaver.datatype.Bill], int][source]
class weaver.store.base.StoreVault(settings: weaver.typedefs.SettingsType | None = None)[source]
type[source]
abstract get_file(file_id: weaver.typedefs.AnyUUID, nothrow: bool = False) weaver.datatype.VaultFile[source]
abstract save_file(file: weaver.datatype.VaultFile) None[source]
abstract delete_file(file: weaver.datatype.VaultFile | weaver.typedefs.AnyUUID) bool[source]
weaver.store.mongodb

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

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

Base class extended by all concrete store implementations.

classmethod get_args_kwargs(*args: Any, **kwargs: Any) Tuple[Tuple, Dict][source]

Filters MongodbStore-specific arguments to safely pass them down its __init__.

class weaver.store.mongodb.MongodbServiceStore(*args: Any, **kwargs: Any)[source]

Registry for OWS services.

Uses MongoDB to store service url and attributes.

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

Stores an OWS service in mongodb.

delete_service(name: str) bool[source]

Removes service from MongoDB storage.

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

Lists all services in MongoDB storage.

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

Gets service for given name from MongoDB storage.

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

Gets service for given url from MongoDB storage.

clear_services() bool[source]

Removes all OWS services from MongoDB storage.

class weaver.store.mongodb.ListingMixin[source]
static _apply_paging_pipeline(page: int | None, limit: int | None) List[MongodbAggregateStep][source]
static _apply_sort_method(sort_field: weaver.sort.AnySortType | None, sort_default: weaver.sort.AnySortType, sort_allowed: List[weaver.sort.AnySortType]) MongodbAggregateSortOrder[source]
static _apply_total_result(search_pipeline: MongodbAggregatePipeline, extra_pipeline: MongodbAggregatePipeline) MongodbAggregatePipeline[source]

Extends the pipeline operations in order to obtain the grand total of matches in parallel to other filtering.

A dual-branch search pipeline is created to apply distinct operations on each facet. The initial search are executed only once for both facets. The first obtains results with other processing steps specified, and the second calculates the total results.

The result of the aggregation pipeline following this operation will be returned in the following format:

[{
    "items": [ MatchedDocument, MatchedDocument, ... ],
    "total": int
}]
Parameters:
  • search_pipeline – pipeline employed to obtain initial matches against search filters.

  • extra_pipeline – additional steps to generate specific results.

Returns:

combination of the grand total of all items and their following processing representation.

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

Registry for processes.

Uses MongoDB to store processes and attributes.

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

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

_add_process(process: weaver.typedefs.AnyProcess, upsert: bool = False) None[source]

Stores the specified process to the database.

The operation assumes that any conflicting or duplicate process definition was pre-validated. Parameter upsert=True can be employed to allow exact replacement and ignoring duplicate errors. When using upsert=True, it is assumed that whichever the result (insert, update, duplicate error) arises, the final result of the stored process should be identical in each case.

Note

Parameter upsert=True is useful for initialization-time of the storage with default processes that can sporadically generate clashing-inserts between multi-threaded/workers applications that all try adding builtin processes around the same moment.

static _get_process_field(process: weaver.typedefs.AnyProcess, function_dict: Dict[weaver.typedefs.AnyProcessClass, Callable[[], Any]] | Callable[[], Any]) Any[source]

Obtain a field from a process instance after validation and using mapping of process implementation functions.

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(process: weaver.typedefs.AnyProcessRef | weaver.typedefs.AnyProcess) str[source]
_get_process_type(process: weaver.typedefs.AnyProcess) weaver.processes.types.AnyProcessType[source]
_get_process_endpoint_wps1(process: weaver.typedefs.AnyProcess) str[source]
save_process(process: weaver.typedefs.AnyProcessRef | weaver.datatype.Process | pywps.Process, overwrite: bool = 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(process_id: str, visibility: weaver.visibility.Visibility | None = 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(visibility: weaver.visibility.AnyVisibility | List[weaver.visibility.AnyVisibility] | None = None, page: int | None = None, limit: int | None = None, sort: weaver.sort.AnySortType | None = None, total: bool = False, revisions: bool = False, process: str | None = None) List[weaver.datatype.Process] | Tuple[List[weaver.datatype.Process], int][source]

Lists all processes in database, optionally filtered by visibility.

Parameters:
  • visibility – One or many value amongst Visibility.

  • page – Page number to return when using result paging.

  • limit – Number of processes per page when using result paging.

  • sort – Field which is used for sorting results (default: process ID, descending).

  • total – Request the total number of processes to be calculated (ignoring paging).

  • revisions – Include all process revisions instead of only latest ones.

  • process – Limit results only to specified process ID (makes sense mostly when combined with revisions).

Returns:

List of sorted, and possibly page-filtered, processes matching queries. If total was requested, return a tuple of this list and the number of processes.

Obtain the search criteria and version of the specified Process ID if it specified a revision tag.

Returns:

Database search operation and the matched version as string.

fetch_by_id(process_id: weaver.typedefs.AnyProcessRef, visibility: weaver.visibility.AnyVisibility | None = 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 (optionally with version tag).

  • visibility – One value amongst weaver.visibility.

Returns:

An instance of weaver.datatype.Process.

find_versions(process_id: weaver.typedefs.AnyProcessRef, version_format: weaver.utils.VersionFormat = VersionFormat.OBJECT) List[weaver.typedefs.AnyVersion][source]

Retrieves all existing versions of a given process.

update_version(process_id: weaver.typedefs.AnyProcessRef, version: weaver.typedefs.AnyVersion) weaver.datatype.Process[source]

Updates the specified (latest) process ID to become an older revision.

See also

Use revert_latest() for the inverse operation.

Returns:

Updated process definition with older revision.

revert_latest(process_id: weaver.typedefs.AnyProcessRef) weaver.datatype.Process[source]

Makes the specified (older) revision process the new latest revision.

Assumes there are no active latest in storage. If one is still defined, it will generate a conflict. The process ID must also contain a tagged revision. Failing to provide a version will fail the operation.

See also

Use update_version() for the inverse operation.

Returns:

Updated process definition with older revision.

get_estimator(process_id: weaver.typedefs.AnyProcessRef) weaver.typedefs.JSON[source]

Get estimator of a process.

set_estimator(process_id: weaver.typedefs.AnyProcessRef, estimator: weaver.typedefs.JSON) None[source]

Set estimator of a process.

get_visibility(process_id: weaver.typedefs.AnyProcessRef) weaver.visibility.Visibility[source]

Get visibility of a process.

Returns:

One value amongst weaver.visibility.

set_visibility(process_id: weaver.typedefs.AnyProcessRef, visibility: weaver.visibility.AnyVisibility) None[source]

Set visibility of a process.

Parameters:
  • visibility – One value amongst weaver.visibility.

  • process_id

Raises:
clear_processes() bool[source]

Clears all processes from the store.

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

Registry for process jobs tracking.

Uses MongoDB to store job attributes.

save_job(task_id: weaver.typedefs.AnyUUID, process: weaver.typedefs.AnyProcessRef, service: weaver.typedefs.AnyServiceRef | None = None, inputs: weaver.typedefs.ExecutionInputs | None = None, outputs: weaver.typedefs.ExecutionOutputs | None = None, is_workflow: bool = False, is_local: bool = False, execute_async: bool = True, execute_response: weaver.execute.AnyExecuteResponse | None = None, custom_tags: List[str] | None = None, user_id: int | None = None, access: weaver.visibility.AnyVisibility | None = None, context: str | None = None, subscribers: weaver.typedefs.ExecutionSubscribers | None = None, accept_language: str | None = None, created: datetime.datetime | None = None) weaver.datatype.Job[source]

Creates a new Job and stores it in mongodb.

batch_update_jobs(job_filter: Dict[str, Any], job_update: Dict[str, Any]) int[source]

Update specified fields of matched jobs against filters.

Parameters:
  • job_update – Fields and values to update on matched jobs.

  • job_filter – Fields to filter jobs to be updated.

Returns:

Number of affected jobs.

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

Updates a job parameters in MongoDB storage.

Parameters:

job – instance of weaver.datatype.Job.

delete_job(job_id: weaver.typedefs.AnyUUID) bool[source]

Removes job from MongoDB storage.

fetch_by_id(job_id: weaver.typedefs.AnyUUID) weaver.datatype.Job[source]

Gets job for given job_id from MongoDB storage.

list_jobs() 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(process: str | None = None, service: str | None = None, job_type: str | None = None, tags: List[str] | None = None, access: str | None = None, status: weaver.status.AnyStatusSearch | List[weaver.status.AnyStatusSearch] | None = None, sort: weaver.sort.AnySortType | None = None, page: int | None = 0, limit: int | None = 10, min_duration: int | None = None, max_duration: int | None = None, datetime_interval: weaver.store.base.DatetimeIntervalType | None = None, group_by: str | List[str] | None = None, request: pyramid.request.Request | None = None) weaver.store.base.JobSearchResult[source]

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

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.

Limit and paging can be disabled by setting them to None. Paging must always be combined with limit, but limit can be employed by itself.

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.

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.

  • job_type – filter matching jobs for given type.

  • tags – list of tags to filter matching jobs.

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

  • 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 or total) when using result paging (only when not using group_by).

  • min_duration – minimal duration (seconds) between started time and current/finished time of jobs to find.

  • max_duration – maximum duration (seconds) between started time and current/finished time of jobs to find.

  • datetime_interval – 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.

_find_jobs_grouped(pipeline: MongodbAggregatePipeline, group_categories: List[str]) Tuple[weaver.store.base.JobGroupCategory, int][source]

Retrieves jobs regrouped by specified field categories and predefined search pipeline filters.

_find_jobs_paging(search_pipeline: MongodbAggregatePipeline, page: int | None, limit: int | None) Tuple[List[weaver.datatype.Job], int][source]

Retrieves jobs limited by specified paging parameters and predefined search pipeline filters.

static _apply_tags_filter(tags: str | List[str] | None) MongodbAggregateExpression[source]
static _apply_access_filter(access: weaver.visibility.AnyVisibility, request: pyramid.request.Request) MongodbAggregateExpression[source]
static _apply_ref_or_type_filter(job_type: str | None, process: str | None, service: str | None) MongodbAggregateExpression[source]
static _apply_status_filter(status: weaver.status.AnyStatusSearch | List[weaver.status.AnyStatusSearch] | None) MongodbAggregateExpression[source]
static _apply_datetime_filter(datetime_interval: weaver.store.base.DatetimeIntervalType | None) MongodbAggregateExpression[source]
static _apply_duration_filter(pipeline: MongodbAggregatePipeline, min_duration: int | None, max_duration: int | None) MongodbAggregatePipeline[source]

Generate the filter required for comparing against Job.duration().

Assumes that the first item of the pipeline is $match since steps must be applied before and after. Pipeline is modified inplace and returned as well.

clear_jobs() bool[source]

Removes all jobs from MongoDB storage.

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

Registry for quotes.

Uses MongoDB to store quote attributes.

_apply_quote(quote: weaver.datatype.Quote, override: bool = False) weaver.datatype.Quote[source]
save_quote(quote: weaver.datatype.Quote) weaver.datatype.Quote[source]

Stores a quote in MongoDB storage.

update_quote(quote: weaver.datatype.Quote) weaver.datatype.Quote[source]

Update quote parameters in MongoDB storage.

fetch_by_id(quote_id: weaver.typedefs.AnyUUID) weaver.datatype.Quote[source]

Gets quote for given quote_id from MongoDB storage.

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

Lists all quotes in MongoDB storage.

find_quotes(process_id: str | None = None, page: int = 0, limit: int = 10, sort: weaver.sort.AnySortType | None = 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 total, where items can have paging and be limited to a maximum per page, but total always indicate the total number of matches excluding paging.

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

Registry for bills.

Uses MongoDB to store bill attributes.

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

Stores a bill in mongodb.

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

Gets bill for given bill_id from MongoDB storage.

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

Lists all bills in MongoDB storage.

find_bills(quote_id: str | None = None, page: int = 0, limit: int = 10, sort: weaver.sort.AnySortType | None = 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 total, where items can have paging and be limited to a maximum per page, but total always indicate the total number of matches excluding paging.

class weaver.store.mongodb.MongodbVaultStore(*args: Any, **kwargs: Any)[source]

Registry for vault files.

Uses MongoDB to store vault files attributes.

get_file(file_id: weaver.typedefs.AnyUUID, nothrow: bool = False) weaver.datatype.VaultFile | None[source]

Gets vault file for given file_id from MongoDB storage.

Raises:

VaultFileNotFound – If the file does not exist and nothrow was not requested.

Returns:

Found file if it exists or None if it doesn’t exist and nothrow was requested.

save_file(file: weaver.datatype.VaultFile) None[source]

Stores a vault file in MongoDB storage.

delete_file(file: weaver.datatype.VaultFile | weaver.typedefs.AnyUUID) bool[source]

Removes vault file from MongoDB storage.

weaver.vault
Submodules
weaver.vault.utils
Module Contents
weaver.vault.utils.VaultInputData[source]
weaver.vault.utils.LOGGER[source]
weaver.vault.utils.REGEX_VAULT_TOKEN[source]
weaver.vault.utils.REGEX_VAULT_UUID[source]
weaver.vault.utils.REGEX_VAULT_FILENAME[source]
weaver.vault.utils.get_vault_dir(container: weaver.typedefs.AnySettingsContainer | None = None) str[source]

Get the base directory of the secure file vault.

weaver.vault.utils.get_vault_path(file: weaver.datatype.VaultFile, container: weaver.typedefs.AnySettingsContainer | None = None) str[source]

Get the full path of the vault file.

weaver.vault.utils.get_vault_url(file: weaver.datatype.VaultFile | uuid.UUID | str, container: weaver.typedefs.AnySettingsContainer | None = None) str[source]

Obtain the vault link corresponding to the file.

weaver.vault.utils.map_vault_location(reference: str, container: weaver.typedefs.AnySettingsContainer = None, url: bool = False, exists: bool = True) str | None[source]

Convert back and forth between the URL and local path references of the Vault file.

See also

Similar operation to weaver.wps.utils.map_wps_output_location().

Warning

Does not validate access token to retrieve the file. It is assumed that pre-valuation was accomplished.

Parameters:
  • reference – Local file path or file URL to be mapped.

  • container – Retrieve application settings.

  • url – Perform URL mapping (local path -> URL endpoint), or map to local path (URL -> local path).

  • exists – Ensure that the mapped file exists, otherwise don’t map it (otherwise None).

Returns:

Mapped reference if applicable, otherwise None.

weaver.vault.utils.parse_vault_token(header: str | None, unique: bool = False) Dict[str | None, str][source]

Parse the authorization header value to retrieve all Vault access tokens and optional file UUID.

See also

Parameters:
  • header – Authorization header to parse.

  • unique – Whether only one or multiple tokens must be retrieved.

Returns:

Found mapping of UUID to access token. If unique, UUID can be None.

weaver.vault.utils.get_vault_auth(request: pyramid.request.Request) Tuple[weaver.typedefs.AnyUUID, str | None][source]

Obtain the requested file reference and parsed access token from the Vault authorization header.

Parameters:

request – Request containing reference file UUID and authorization headers.

Returns:

Extracted file reference and authentication token.

Raises:

Appropriate HTTP exception according to use case.

weaver.vault.utils.get_authorized_file(file_id: weaver.typedefs.AnyUUID, auth_token: str, container: weaver.typedefs.AnySettingsContainer | None = None) weaver.datatype.VaultFile[source]

Obtain the requested file if access is granted.

Parameters:
  • file_id – Vault storage reference file UUID.

  • auth_token – Token to obtain access to the file.

  • container – Application settings.

Returns:

Authorized file.

Raises:

Appropriate HTTP exception according to use case.

weaver.vault.utils.decrypt_from_vault(vault_file: weaver.datatype.VaultFile, path: str, out_dir: str | None = None, delete_encrypted: bool = False) str[source]

Decrypts a Vault file and optionally removes its encrypted version.

Parameters:
  • vault_file – Reference file in Vault.

  • path – Expected location of the encrypted file.

  • out_dir – Desired output location, or temporary directory.

  • delete_encrypted – Delete original encrypted file after decryption for output.

Returns:

Output location of the decrypted file.

weaver.vault.views
Module Contents
weaver.vault.views.LOGGER[source]
weaver.vault.views.upload_file(request: pyramid.request.Request) pyramid.httpexceptions.HTTPException[source]

Upload a file to secured vault.

weaver.vault.views.describe_file(request: pyramid.request.Request) pyramid.httpexceptions.HTTPException[source]

Get authorized vault file details without downloading it.

weaver.vault.views.download_file(request: pyramid.request.Request) pyramid.response.FileResponse[source]

Download authorized vault file and remove it from the vault.

Package Contents
weaver.vault.LOGGER[source]
weaver.vault.includeme(config: pyramid.config.Configurator) None[source]
weaver.wps

Views for WPS-XML endpoint implemented with pywps.

Submodules
weaver.wps.app

PyWPS 4.x wrapper.

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.WorkerRequest(http_request: weaver.typedefs.AnyRequestType | None = None, http_headers: weaver.typedefs.AnyHeadersContainer | None = None, **kwargs: Any)[source]

Extended pywps request with additional handling provided by weaver.

_auth_headers[source]
parse_auth_headers(headers: weaver.typedefs.AnyHeadersContainer | None) weaver.typedefs.HeadersType[source]
class weaver.wps.service.WorkerExecuteResponse(wps_request: WorkerRequest, uuid: str, process: pywps.app.Process, job_url: str, settings: weaver.typedefs.SettingsType, *_: 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(wps_request: pywps.app.WPSRequest, *_: Any, **__: Any) pywps.response.basic.WPSResponse | weaver.typedefs.HTTPValid | None[source]

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

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

Handles the GetCapabilities KVP/XML request submitted on the WPS endpoint.

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

_describe_process_redirect(wps_request: pywps.app.WPSRequest, *_: Any, **__: Any) pywps.response.basic.WPSResponse | weaver.typedefs.HTTPValid | None[source]

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

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

Handles the DescribeProcess KVP/XML request submitted on the WPS endpoint.

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

_submit_job(wps_request: pywps.app.WPSRequest) pywps.response.basic.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.

Returns the status response as is if XML, or convert it to JSON, according to request Accept header.

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

Handles dispatched remote provider process preparation during execution request.

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

Handles the Execute KVP/XML request submitted on the WPS endpoint.

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

Overrides the original execute operation, that will instead be handled by execute_job() following callback from Celery Worker, which 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(job: weaver.datatype.Job, wps_inputs: List[weaver.typedefs.WPS_InputData], wps_outputs: List[weaver.typedefs.WPS_OutputRequested], remote_process: weaver.datatype.Process | None, headers: weaver.typedefs.AnyHeadersContainer | None) owslib.wps.WPSExecution[source]

Real execution of the process by active Celery Worker.

weaver.wps.service.get_pywps_service(environ: weaver.typedefs.SettingsType = None, is_worker: bool = False) WorkerService[source]

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

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

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

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

URL location of the XML status file.

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

Directory location of the XML status file.

store(*_, **__)[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(*_, **__)[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

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, load: bool = False) str[source]
weaver.wps.utils.get_wps_path(container: weaver.typedefs.AnySettingsContainer, load: bool = True) 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, load: bool = True) 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, load: bool = True) 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, load: bool = True) 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, load: bool = True) 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_output_context(request: weaver.typedefs.AnyRequestType) str | None[source]

Obtains and validates allowed values for sub-directory context of WPS outputs in header X-WPS-Output-Context.

Raises:

HTTPUnprocessableEntity – if the header was provided and contains invalid or illegal value.

Returns:

validated context or None if not specified.

weaver.wps.utils.get_wps_local_status_location(url_status_location: str, container: weaver.typedefs.AnySettingsContainer, must_exist: bool = True) str | None[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.map_wps_output_location(reference: str, container: weaver.typedefs.AnySettingsContainer, url: bool = False, exists: bool = True, file_scheme: bool = False) str | None[source]

Obtains the mapped WPS output location of a file where applicable.

Parameters:
  • reference – Local file path or file URL to be mapped.

  • container – Retrieve application settings.

  • url – Perform URL mapping (True: local path -> URL endpoint, False: URL endpoint -> local path).

  • exists – Ensure that the mapped file exists, otherwise don’t map it (otherwise None).

  • file_scheme – Ensure that the ‘file://’ scheme is applied to resulting local file location when mapped from WPS output URL. When in ‘reverse’ mode, ‘file://’ is always removed if present to form a potential local file path.

Returns:

Mapped reference that corresponds to the local/URL WPS output location.

weaver.wps.utils._describe_process_cached(self: owslib.wps.WebProcessingService, identifier: str, xml: weaver.xml_util.XML | None = None) weaver.typedefs.ProcessOWS[source]
weaver.wps.utils._get_wps_client_cached(url: str, headers: weaver.typedefs.HeadersType, verify: bool, language: str | None) owslib.wps.WebProcessingService[source]
weaver.wps.utils.get_wps_client(url: str, container: weaver.typedefs.AnySettingsContainer | None = None, verify: bool = None, headers: weaver.typedefs.HeadersType | None = None, language: str | None = 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: str | None = None, response: weaver.xml_util.XML | None = None, sleep_secs: int = 2, verify: bool = True, settings: weaver.typedefs.AnySettingsContainer | None = 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.get_exception_from_xml_status(xml: weaver.xml_util.XML | str) weaver.owsexceptions.OWSException | None[source]

Retrieves the OWS exception that corresponds to the XML status.

Expects the following XML status response structure (ows:Exception block can be at any level):

<ows:Exception exceptionCode="NoApplicableCode" locator="None">
  <ows:ExceptionText>Error message about the cause of the exception.</ows:ExceptionText>
</ows:Exception>
Parameters:

xml – XML tree object with exception details.

Returns:

Matched owsexceptions.OWSException. If no matching exception code is found within available exception classes, defaults to generic OWSException. If any parsing error occurs, returns nothing.

weaver.wps.utils.load_pywps_config(container: weaver.typedefs.AnySettingsContainer, config: str | Dict[str, str] | None = 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: str | None = None, request: weaver.typedefs.AnyRequestType | None = None) str | None[source]

Applies the best match between requested accept languages and supported ones by the WPS server.

Given the Accept-Language header value, match the best language to the supported languages retrieved from WPS. By default, and if no match is found, sets WebProcessingService.language property to None.

See also

Details about the format of the Accept-Language header: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept-Language

Note

This function considers quality-factor weighting and parsing resolution of Accept-Language header according to RFC 7231#section-5.3.2.

Parameters:
  • wps – service for which to apply a supported language if matched.

  • accept_language – value of the Accept-Language header.

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

Returns:

language that has been set, or None if no match could be found.

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_queried_jobs(request: weaver.typedefs.PyramidRequest) pyramid.httpexceptions.HTTPOk[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: weaver.typedefs.PyramidRequest) pyramid.httpexceptions.HTTPOk[source]

Retrieve the status of a job.

weaver.wps_restapi.jobs.jobs.cancel_job(request: weaver.typedefs.PyramidRequest) weaver.typedefs.AnyResponseType[source]

Dismiss a planned or running job execution, or remove result artifacts of a completed job.

Note:

Will only stop tracking this particular process execution when not supported by underlying provider services such as WPS 1.0. Services supporting cancel operation could attempt to terminate remote jobs.

weaver.wps_restapi.jobs.jobs.cancel_job_batch(request: weaver.typedefs.PyramidRequest) weaver.typedefs.AnyResponseType[source]

Dismiss operation for multiple jobs.

Note:

Will only stop tracking jobs when underlying remote provider services do not support cancel operation.

weaver.wps_restapi.jobs.jobs.get_job_inputs(request: weaver.typedefs.PyramidRequest) weaver.typedefs.AnyResponseType[source]

Retrieve the inputs values and outputs definitions of a job.

weaver.wps_restapi.jobs.jobs.get_job_outputs(request: weaver.typedefs.PyramidRequest) weaver.typedefs.AnyResponseType[source]

Retrieve the output values resulting from a job execution.

weaver.wps_restapi.jobs.jobs.get_job_results(request: weaver.typedefs.PyramidRequest) weaver.typedefs.AnyResponseType[source]

Retrieve the results of a job.

weaver.wps_restapi.jobs.jobs.get_job_exceptions(request: weaver.typedefs.PyramidRequest) weaver.typedefs.AnyResponseType[source]

Retrieve the exceptions of a job.

weaver.wps_restapi.jobs.jobs.get_job_logs(request: weaver.typedefs.PyramidRequest) weaver.typedefs.AnyResponseType[source]

Retrieve the logs of a job.

weaver.wps_restapi.jobs.jobs.get_job_stats(request: weaver.typedefs.PyramidRequest) weaver.typedefs.AnyResponseType[source]

Retrieve the statistics of a job.

weaver.wps_restapi.jobs.jobs.redirect_job_result(request: weaver.typedefs.PyramidRequest) weaver.typedefs.AnyResponseType[source]

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

weaver.wps_restapi.jobs.utils
Module Contents
weaver.wps_restapi.jobs.utils.LOGGER[source]
weaver.wps_restapi.jobs.utils.get_job(request: weaver.typedefs.PyramidRequest) weaver.datatype.Job[source]

Obtain a Job from request parameters.

Changed in version 4.20: When looking for Job that refers to a local Process, allow implicit resolution of the unspecified version portion to automatically resolve the identifier. Consider that validation of the expected Process for this Job is “good enough”, since the specific ID is not actually required to obtain the Job (could be queried by ID only on the /jobs/{jobId} endpoint. If the version is provided though (either query parameter or tagged representation), the validation will ensure that it matches explicitly.

Parameters:

request – Request with path and query parameters to retrieve the desired job.

Returns:

Job information if found.

Raises:

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

Obtains a list of all relevant links for the corresponding job listing defined by query parameter filters.

Raises:

IndexError – if the paging values are out of bounds compared to available total Job matching search.

weaver.wps_restapi.jobs.utils.get_schema_query(schema: weaver.processes.constants.JobInputsOutputsSchemaType | None, strict: bool = True) weaver.processes.constants.JobInputsOutputsSchemaType | None[source]

Convert a result definition as value into the corresponding reference for output transmission.

See also

RFC 8288: HTTP Link header specification.

weaver.wps_restapi.jobs.utils.get_results(job: weaver.datatype.Job, container: weaver.typedefs.AnySettingsContainer, value_key: str | None = None, schema: weaver.processes.constants.JobInputsOutputsSchemaType = JobInputsOutputsSchema.OLD, link_references: bool = False) Tuple[weaver.typedefs.ExecutionResults, weaver.typedefs.HeadersTupleType][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.

  • schema – Selects which schema to employ for representing the output results (listing or mapping).

  • link_references – If enabled, an output that was requested by reference instead of by value will be returned as Link header.

Returns:

Tuple with:
  • List or mapping of all outputs each with minimally an ID and value under the requested key.

  • List of Link headers for reference outputs when requested. Empty otherwise.

weaver.wps_restapi.jobs.utils.get_job_results_response(job: weaver.datatype.Job, container: weaver.typedefs.AnySettingsContainer, headers: weaver.typedefs.AnyHeadersContainer | None = None) weaver.typedefs.AnyResponseType[source]

Generates the OGC compliant Job results response according to submitted execution parameters.

Parameters that impact the format of the response are:
  • Amount of outputs to be returned.

  • Parameter response: raw|document

  • Parameter transmissionMode: value|reference per output if response: raw.

Parameters:
  • job – Job for which to generate the results response.

  • container – Application settings.

  • headers – Additional headers to provide in the response.

weaver.wps_restapi.jobs.utils.get_job_submission_response(body: weaver.typedefs.JSON, headers: weaver.typedefs.AnyHeadersContainer, error: bool = False) pyramid.httpexceptions.HTTPOk | pyramid.httpexceptions.HTTPCreated[source]

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

If Job already finished processing within requested Prefer: wait=X seconds delay (and if allowed by the Process jobControlOptions), return the successful status immediately instead of created status.

Otherwise, return the status monitoring location of the created Job to be monitored asynchronously.

weaver.wps_restapi.jobs.utils.validate_service_process(request: weaver.typedefs.PyramidRequest) Tuple[str | None, str | None][source]

Verifies that any Provider or Process specified by path or query are valid.

Raises:

HTTPException – Relevant HTTP error with details if validation failed.

Returns:

Validated and existing service and process if specified.

weaver.wps_restapi.jobs.utils.raise_job_bad_status(job: weaver.datatype.Job, container: weaver.typedefs.AnySettingsContainer | None = None) None[source]

Raise the appropriate message for Job not ready or unable to retrieve output results due to status.

weaver.wps_restapi.jobs.utils.raise_job_dismissed(job: weaver.datatype.Job, container: weaver.typedefs.AnySettingsContainer | None = None) None[source]

Raise the appropriate messages for dismissed Job status.

weaver.wps_restapi.jobs.utils.dismiss_job_task(job: weaver.datatype.Job, container: weaver.typedefs.AnySettingsContainer) weaver.datatype.Job[source]

Cancels any pending or running Celery task and removes completed job artifacts.

Note

The Job object itself is not deleted, only its artifacts. Therefore, its inputs, outputs, logs, exceptions, etc. are still available in the database, but corresponding files that would be exposed by weaver.wps_output configurations are removed.

Parameters:
  • job – Job to cancel or cleanup.

  • container – Application settings.

Returns:

Updated and dismissed job.

Package Contents
weaver.wps_restapi.jobs.LOGGER[source]
weaver.wps_restapi.jobs.includeme(config: pyramid.config.Configurator) None[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.get_processes(request: weaver.typedefs.PyramidRequest) weaver.typedefs.AnyViewResponse[source]

List registered processes (GetCapabilities).

Optionally list both local and provider processes.

weaver.wps_restapi.processes.processes.add_local_process(request: weaver.typedefs.PyramidRequest) weaver.typedefs.AnyViewResponse[source]

Register a local process.

weaver.wps_restapi.processes.processes.put_local_process(request: weaver.typedefs.PyramidRequest) weaver.typedefs.AnyViewResponse[source]

Update a registered local process with a new definition.

Updates the new process MAJOR semantic version from the previous one if not specified explicitly. For MINOR or PATCH changes to metadata of the process definition, consider using the PATCH request.

weaver.wps_restapi.processes.processes.patch_local_process(request: weaver.typedefs.PyramidRequest) weaver.typedefs.AnyViewResponse[source]

Update metadata of a registered local process.

Updates the new process MINOR or PATCH semantic version if not specified explicitly, based on updated contents. Changes that impact only metadata such as description or keywords imply PATCH update. Changes to properties that might impact process operation such as supported formats implies MINOR update. Changes that completely redefine the process require a MAJOR update using PUT request.

weaver.wps_restapi.processes.processes.get_local_process(request: weaver.typedefs.PyramidRequest) weaver.typedefs.AnyViewResponse[source]

Get a registered local process information (DescribeProcess).

weaver.wps_restapi.processes.processes.get_local_process_package(request: weaver.typedefs.PyramidRequest) weaver.typedefs.AnyViewResponse[source]

Get a registered local process package definition.

weaver.wps_restapi.processes.processes.get_local_process_payload(request: weaver.typedefs.PyramidRequest) weaver.typedefs.AnyViewResponse[source]

Get a registered local process payload definition.

weaver.wps_restapi.processes.processes.get_process_visibility(request: weaver.typedefs.PyramidRequest) weaver.typedefs.AnyViewResponse[source]

Get the visibility of a registered local process.

weaver.wps_restapi.processes.processes.set_process_visibility(request: weaver.typedefs.PyramidRequest) weaver.typedefs.AnyViewResponse[source]

Set the visibility of a registered local process.

weaver.wps_restapi.processes.processes.delete_local_process(request: weaver.typedefs.PyramidRequest) weaver.typedefs.AnyViewResponse[source]

Unregister a local process.

weaver.wps_restapi.processes.processes.submit_local_job(request: weaver.typedefs.PyramidRequest) weaver.typedefs.AnyViewResponse[source]

Execute a process registered locally.

Execution location and method is according to deployed Application Package.

weaver.wps_restapi.processes.utils
Module Contents
weaver.wps_restapi.processes.utils.LOGGER[source]
weaver.wps_restapi.processes.utils.resolve_process_tag(request: weaver.typedefs.PyramidRequest, process_query: bool = False) str[source]

Obtain the tagged Process reference from request path and/or query according to available information.

Whether the Process is specified by path or query, another version query can be provided to specify the desired revision by itself. This version query is considered only if another version indication is not already specified in the Process reference using the tagged semantic.

When process_query = False, possible combinations are as follows:

  • /processes/{processID}:{version}

  • /processes/{processID}?version={version}

When process_query = True, possible combinations are as follows:

  • /...?process={processID}:{version}

  • /...?process={processID}&version={version}

Parameters:
  • request – Request from which to retrieve the process reference.

  • process_query – Whether the process ID reference is located in request path or process={id} query.

weaver.wps_restapi.processes.utils.get_processes_filtered_by_valid_schemas(request: weaver.typedefs.PyramidRequest, detail: bool = True) Tuple[List[weaver.typedefs.JSON], List[str], Dict[str, int | None], bool, int][source]

Validates the processes summary schemas and returns them into valid/invalid lists.

Returns:

List of valid process and invalid processes IDs for manual cleanup, along with filtering parameters.

Obtains a list of all relevant links for the corresponding Process listing defined by query parameters.

Raises:

IndexError – if the paging values are out of bounds compared to available total Process.

Package Contents
weaver.wps_restapi.processes.LOGGER[source]
weaver.wps_restapi.processes.includeme(config: pyramid.config.Configurator) None[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_providers(request: weaver.typedefs.PyramidRequest) weaver.typedefs.AnyViewResponse[source]

Lists registered providers.

weaver.wps_restapi.providers.providers.add_provider(request: weaver.typedefs.PyramidRequest) weaver.typedefs.AnyViewResponse[source]

Register a new service provider.

weaver.wps_restapi.providers.providers.remove_provider(request: weaver.typedefs.PyramidRequest) weaver.typedefs.AnyViewResponse[source]

Remove an existing service provider.

weaver.wps_restapi.providers.providers.get_provider(request: weaver.typedefs.PyramidRequest) weaver.typedefs.AnyViewResponse[source]

Get a provider definition (GetCapabilities).

weaver.wps_restapi.providers.providers.get_provider_processes(request: weaver.typedefs.PyramidRequest) weaver.typedefs.AnyViewResponse[source]

Retrieve available provider processes (GetCapabilities).

weaver.wps_restapi.providers.providers.describe_provider_process(request: weaver.typedefs.PyramidRequest) 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.providers.providers.get_provider_process(request: weaver.typedefs.PyramidRequest) weaver.typedefs.AnyViewResponse[source]

Retrieve a remote provider’s process description (DescribeProcess).

weaver.wps_restapi.providers.providers.get_provider_process_package(request: weaver.typedefs.PyramidRequest) weaver.typedefs.AnyViewResponse[source]

Retrieve a remote provider’s process Application Package definition.

weaver.wps_restapi.providers.providers.submit_provider_job(request: weaver.typedefs.PyramidRequest) weaver.typedefs.AnyViewResponse[source]

Execute a remote provider process.

weaver.wps_restapi.providers.utils
Module Contents
weaver.wps_restapi.providers.utils.LOGGER[source]
weaver.wps_restapi.providers.utils.get_provider_services(container: weaver.typedefs.AnySettingsContainer, check: bool = True, ignore: bool = True) List[weaver.datatype.Service][source]

Obtain the list of remote provider services.

Parameters:
  • container – definition to retrieve settings and database connection.

  • check – request that all provider services are remotely accessible to fetch metadata from them.

  • ignore – given that any provider service is not accessible, ignore it or raise the error.

weaver.wps_restapi.providers.utils.forbid_local_only(container: weaver.typedefs.AnySettingsContainer) Any[source]

Raises an HTTP exception forbidding to resume the operation if invalid configuration is detected.

weaver.wps_restapi.providers.utils.check_provider_requirements(func: Callable[[weaver.typedefs.AnySettingsContainer], Any]) Callable[[weaver.typedefs.AnySettingsContainer], Any][source]

Decorator to validate if Provider operations are applicable for the current Weaver instance.

weaver.wps_restapi.providers.utils.get_service(request: weaver.typedefs.AnyRequestType) Tuple[weaver.datatype.Service, weaver.store.base.StoreServices][source]

Get the request service using provider_id from the service store.

Package Contents
weaver.wps_restapi.providers.LOGGER[source]
weaver.wps_restapi.providers.includeme(config: pyramid.config.Configurator) None[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: weaver.typedefs.PyramidRequest) weaver.typedefs.AnyViewResponse[source]

Get list of bills IDs.

weaver.wps_restapi.quotation.bills.get_bill_info(request: weaver.typedefs.PyramidRequest) weaver.typedefs.AnyViewResponse[source]

Get bill information.

weaver.wps_restapi.quotation.quotes
Module Contents
weaver.wps_restapi.quotation.quotes.LOGGER[source]
weaver.wps_restapi.quotation.quotes.get_quote_response(quote: weaver.datatype.Quote, http_class: Type[pyramid.httpexceptions.HTTPOk] | Type[pyramid.httpexceptions.HTTPCreated], schema_class: Type[colander.SchemaNode], description: str, settings: weaver.typedefs.AnySettingsContainer) pyramid.httpexceptions.HTTPOk | pyramid.httpexceptions.HTTPCreated[source]

Validate the quote contents and generate the response with its relevant details.

weaver.wps_restapi.quotation.quotes.request_quote(request: weaver.typedefs.PyramidRequest) weaver.typedefs.AnyViewResponse[source]

Request a quotation for a process.

weaver.wps_restapi.quotation.quotes.get_process_quote_estimator(request: weaver.typedefs.PyramidRequest) weaver.typedefs.AnyViewResponse[source]

Get the process quote estimator configuration.

weaver.wps_restapi.quotation.quotes.update_process_quote_estimator(request: weaver.typedefs.PyramidRequest) weaver.typedefs.AnyViewResponse[source]

Replace the process quote estimator configuration.

weaver.wps_restapi.quotation.quotes.delete_process_quote_estimator(request: weaver.typedefs.PyramidRequest) weaver.typedefs.AnyViewResponse[source]

Reset the process quote estimator configuration to the default values.

weaver.wps_restapi.quotation.quotes.get_quote_list(request: weaver.typedefs.PyramidRequest) weaver.typedefs.AnyViewResponse[source]

Get list of quotes IDs.

weaver.wps_restapi.quotation.quotes.get_quote_info(request: weaver.typedefs.PyramidRequest) weaver.typedefs.AnyViewResponse[source]

Get quote information.

weaver.wps_restapi.quotation.quotes.execute_quote(request: weaver.typedefs.PyramidRequest) weaver.typedefs.AnyViewResponse[source]

Execute a quoted process.

weaver.wps_restapi.quotation.utils
Module Contents
weaver.wps_restapi.quotation.utils.LOGGER[source]
weaver.wps_restapi.quotation.utils.check_quotation_supported(container: weaver.typedefs.AnySettingsContainer) bool[source]

Request view decorator that validates the instance configuration permits the quotation extension.

weaver.wps_restapi.quotation.utils.get_quote(request: weaver.typedefs.AnyRequestType) weaver.datatype.Quote[source]

Obtain the referenced Quote by the request with validation.

Parameters:

request

Returns:

Matched quote.

Raises:

HTTPNotFound – If the quote could not be found.

Package Contents
weaver.wps_restapi.quotation.LOGGER[source]
weaver.wps_restapi.quotation.includeme(config: pyramid.config.Configurator) None[source]
Submodules
weaver.wps_restapi.api
Module Contents
weaver.wps_restapi.api.Conformance[source]
weaver.wps_restapi.api.LOGGER[source]
weaver.wps_restapi.api.get_conformance(category: weaver.wps_restapi.constants.AnyConformanceCategory | None) Conformance[source]

Obtain the conformance references.

See also

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: str | None = None, use_refs: bool = True, use_docstring_summary: bool = True, settings: weaver.typedefs.SettingsType | None = None) weaver.typedefs.OpenAPISpecification[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: Any, **kwargs: Any) weaver.typedefs.OpenAPISpecification[source]
weaver.wps_restapi.api.openapi_json(request: pyramid.request.Request) pyramid.httpexceptions.HTTPException[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: str | None = 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: Callable[[pyramid.request.Request], pyramid.httpexceptions.HTTPException]) Callable[[pyramid.httpexceptions.HTTPException, pyramid.request.Request], pyramid.httpexceptions.HTTPException][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.DataT[source]
weaver.wps_restapi.colander_extras.RegexPattern[source]
weaver.wps_restapi.colander_extras.LITERAL_SCHEMA_TYPES[source]
weaver.wps_restapi.colander_extras.NO_DOUBLE_SLASH_PATTERN = '(?!.*//.*$)'[source]
weaver.wps_restapi.colander_extras.URL_REGEX[source]
weaver.wps_restapi.colander_extras.URL[source]
weaver.wps_restapi.colander_extras.FILE_URL_REGEX[source]
weaver.wps_restapi.colander_extras.FILE_URI[source]
weaver.wps_restapi.colander_extras.URI_REGEX[source]
weaver.wps_restapi.colander_extras.URI[source]
weaver.wps_restapi.colander_extras._make_node_instance(schema_node_or_class: 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: colander.SchemaNode | Type[colander.SchemaNode], check: bool = False) colander.SchemaType | None[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 the 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

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: Iterable[str], *args: Any, **kwargs: Any)[source]

Validator that ensures the given value matches one of the available choices, but allowing case-insensitive values.

class weaver.wps_restapi.colander_extras.StringOneOf(choices: Iterable[str], delimiter: str = ',', case_sensitive: bool = True, **kwargs: Any)[source]

Validator that ensures the given value matches one of the available choices, but defined by string delimited values.

class weaver.wps_restapi.colander_extras.BoundedRange(min: float | int | None = None, max: float | int | None = None, exclusive_min: bool = False, exclusive_max: bool = False, **kwargs: Any)[source]

Validator of value within range with added exclusive bounds support.

class weaver.wps_restapi.colander_extras.StringRange(min: float | int | str | None = None, max: float | int | str | None = None, exclusive_min: bool = False, exclusive_max: bool = False, **kwargs: Any)[source]

Validator that provides the same functionalities as colander.Range for a numerical string value.

class weaver.wps_restapi.colander_extras.CommaSeparated(allow_chars: str = 'A-Za-z0-9_-', msg: str = _MSG_ERR, flags: re.RegexFlag = re.IGNORECASE)[source]

Validator that ensures the given value is a comma-separated string.

_MSG_ERR[source]
class weaver.wps_restapi.colander_extras.SchemeURL(schemes: Iterable[str] | None = None, path_pattern: None | str | RegexPattern = None, msg: str | None = None, flags: re.RegexFlag | None = 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://] URL

class weaver.wps_restapi.colander_extras.SemanticVersion(*args: Any, v_prefix: bool = False, rc_suffix: bool = True, **kwargs: Any)[source]

String representation that is valid against Semantic Versioning specification.

class weaver.wps_restapi.colander_extras.ExtendedBoolean(*args: Any, true_choices: Iterable[str] | None = None, false_choices: Iterable[str] | None = None, allow_string: bool = False, **kwargs: Any)[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.

Initializes the extended boolean schema node.

When arguments true_choices or false_choices are provided, the corresponding string values are respectively considered as valid truthy/falsy values. Otherwise (default), strict values only of explicit type bool will be considered valid.

When values are specified colander converts them to string lowercase to compare against truthy/falsy values it should accept. For real OpenAPI typing validation, do NOT add other values like "1" to avoid conflict with ExtendedInteger type for schemas that support both variants. If an OpenAPI field is expected to support truthy/falsy values, it is recommended to explicitly define its schema using a oneOf keyword of all relevant schemas it supports, an any applicable validators for explicit values. This is the safest way to ensure the generated OpenAPI schema corresponds to expected type validation.

deserialize(node: colander.SchemaNode, cstruct: Any) Type[colander.null, bool][source]
class weaver.wps_restapi.colander_extras.ExtendedNumber(*_, allow_string=False, strict=True, **__)[source]

Definition of a numeric value, either explicitly or implicit with permissive str representation.

Behaviour in each case:
  • strict=True and allow_string=False: Value can only be explicit numeric type that matches exactly the base num type (default). All implicit conversion between float, int or str are disallowed.

  • strict=True and allow_string=True: Value can be the explicit numeric type (int or float) or a numeric str value representing the corresponding base numeric type. Implicit conversion between float and int is still disallowed.

  • strict=False (allow_string doesn’t matter): Value can be anything as long as it can be converted to the expected numeric type (int or float).

Recommended usage:
  • When making OpenAPI schema definitions for JSON body elements within a request or response object, default parameters strict=True and allow_string=False should be used to ensure the numeric type is respected. As for other literal data Extended schema types, keyword oneOf should be used when multiple similar value types are permitted for a field in order to document in OpenAPI the specific type definitions of expected data, which is automatically converted by json properties of request and response classes.

  • When defining OpenAPI query parameters, strict=True and allow_string=True should be used. This ensures that documented schemas still indicate only the numeric type as expected data format, although technically the path of the request will contain a str representing the number. Queries are not automatically converted by request objects, but will be converted and validated as the explicit number following deserialization when using those configuration parameters.

abstract static number(num)[source]
abstract static strict(num)[source]
class weaver.wps_restapi.colander_extras.ExtendedFloat(*_: Any, allow_string: bool = False, strict: bool = True, **__: Any)[source]

Float definition with strict typing validation by default.

This is to distinguish it from explicit definitions of float-like numbers or strings. By default, values such as "1", 1.0, True will not be automatically converted to equivalent 1.0.

static number(num)[source]
static strict(num)[source]
serialize(node, appstruct)[source]
class weaver.wps_restapi.colander_extras.ExtendedInteger(*_: Any, allow_string: bool = False, strict: bool = True, **__: Any)[source]

Integer definition with strict typing validation by default.

This is to distinguish it from explicit definitions of integer-like numbers or strings. By default, values such as "1", 1.0, True will not be automatically converted to equivalent 1.

static number(num)[source]
static strict(num)[source]
serialize(node, appstruct)[source]
class weaver.wps_restapi.colander_extras.ExtendedString(encoding=None, allow_empty=False)[source]

String with auto-conversion for known OpenAPI format field where no direct colander type exist.

Converts uuid.UUID to corresponding string when detected in the node if it defined format="uuid".

For format="date" and format="date-time", consider instead using colander.Date and colander.DateTime respectively since more advanced support and features are provided with them.

deserialize(node: colander.SchemaNode, cstruct: Any) str[source]
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 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

property xml[source]
attribute[source]
name[source]
namespace[source]
prefix[source]
wrapped[source]
class weaver.wps_restapi.colander_extras.ExtendedNodeInterface[source]
_extension: str[source]
abstract _deserialize_impl(cstruct)[source]
class weaver.wps_restapi.colander_extras.ExtendedSchemaMeta(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]

Schema that can be dropped if the value is missing.

Drops the underlying schema node if missing=drop was specified and that the value representing it represents an empty value instead of raising a invalid schema error.

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(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(cstruct)[source]
class weaver.wps_restapi.colander_extras.DefaultSchemaNode(*args, **kwargs)[source]

Schema that will return the provided default value when the corresponding value is missing or invalid.

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(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(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>.

Note

In order to avoid invalid rendering of <> strings (interpreted as HTML tags by Swagger-UI), it is recommended to employ {} notation for representing variable names.

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(node: colander.SchemaNode) bool[source]

If current node is the variable field definition.

has_variables()[source]

If the current container schema node has sub-node variables.

abstract static schema_type()[source]
_mark_variable_children()[source]

Ensures that any immediate children schema with variable key are detected.

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(subnodes: Iterable[colander.SchemaNode]) List[VariableSchemaNode][source]
deserialize(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.

static _check_deserialize(node, cstruct)[source]
static _deserialize_remap(node, cstruct, var_map, var_name, has_const_child)[source]
_deserialize_impl(cstruct)[source]
_validate_cross_variable_mapping(variable_mapping: VariableSchemaNodeMapping) None[source]

Ensure there are no matches of the same child-property across multiple variable child-schema.

In such case, the evaluated variable mapping is ambiguous, and cannot discriminate which property validates the schema. Therefore, the full mapping schema containing the variables would be invalid.

There are 2 possible situations where there could be multiple variable child-schema. Either additionalProperties and patternProperties capability is supported and employed simultaneously, or the schema class definition is invalid. It is not allowed to have 2 generic additionalProperties assigned simultaneously to 2 distinct child-schema. A single child-schema using a keyword mapping should be used instead to define such combinations.

_validate_unmatched_variable_mapping(variable_mapping: VariableSchemaNodeMapping, invalid_mapping: Dict[str, colander.Invalid], constant_children_schema_names: List[str], cstruct: weaver.typedefs.JSON) None[source]

Validate if any additional properties that could not be mapped by variables are permitted in the mapping schema.

class weaver.wps_restapi.colander_extras.SortableMappingSchema(*args, **kwargs)[source]

Adds sorting capabilities to mapping schema.

Extended schema nodes that inherit from colander.Mapping schema-type such that they can request ordering of resulting fields by overriding properties _sort_first and _sort_after within the schema definition with lists of fields names to sort.

_extension = '_ext_sortable'[source]
_sort_first: Sequence[str] = [][source]
_sort_after: Sequence[str] = [][source]
deserialize(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.

abstract static schema_type()[source]
_deserialize_impl(cstruct)[source]
static _order_deserialize(cstruct: Dict[str, Any], sort_first: Sequence[str] | None = None, sort_after: Sequence[str] | None = None) Dict[str, Any][source]

Enforces ordering of expected fields in deserialized result, regardless of specified children/inherited schema.

This function takes care of moving back items in a consistent order for better readability from API responses against different loaded definitions field order from remote servers, local database, pre-defined objects, etc.

This way, any field insertion order from both the input cstruct following deserialization operation, the internal mechanics that colander (and extended OpenAPI schema definitions) employ to process this deserialization, and the result dictionary fields order obtained from it all don’t matter.

Using this, the order of inheritance of schema children classes also doesn’t matter, removing the need to worry about placing classes in any specific order when editing and joining the already complicated structures of inherited schemas.

Parameters:
  • cstruct – JSON structure to be sorted that has already been processed by a schema’s deserialize call.

  • sort_first – ordered list of fields to place first in the result.

  • sort_after – ordered list of fields to place last in the result.

Returns:

results formed from cstruct following order: (<fields_firsts> + <other_fields> + <fields_after>)

class weaver.wps_restapi.colander_extras.SchemaRefMappingSchema(*args, **kwargs)[source]

Mapping schema that supports auto-insertion of JSON-schema references provided in the definition.

Schema references are resolved under two distinct contexts:

  1. When generating the JSON schema representation of the current schema node, for OpenAPI representation, the _schema attribute will indicate the $id value that identifies this schema, while the _schema_meta will provide the $schema property that refers to the JSON meta-schema used by default to define it.

  2. When deserializing JSON data that should be validated against the current schema node, the generated JSON data will include the $schema property using the _schema attribute. In this case, the $id is omitted as that JSON represents an instance of the schema, but not its identity.

Alternatively, the parameters schema and schema_meta can be passed as keyword arguments when instantiating the schema node. The references injection in the JSON schema and data can be disabled with parameters schema_include and schema_meta_include, or the corresponding class attributes. Furthermore, options schema_include_deserialize, schema_include_convert_type and schema_meta_include_convert_type can be used to control individually each schema inclusion during either the type conversion context (JSON schema) or the deserialization context (JSON data validation).

property _schema_options[source]
property _schema_fields[source]
_extension = '_ext_schema_ref'[source]
_ext_schema_options = ['_schema_meta', '_schema_meta_include', '_schema_meta_include_convert_type', '_schema',...[source]
_ext_schema_fields = ['_id', '_schema'][source]
_schema_meta: str[source]
_schema_meta_include: bool = True[source]
_schema_meta_include_convert_type: bool = True[source]
_schema: str[source]
_schema_include: bool = True[source]
_schema_include_deserialize: bool = True[source]
_schema_include_convert_type: bool = True[source]
static _is_schema_ref(schema_ref: Any) bool[source]
_schema_deserialize(cstruct: weaver.typedefs.OpenAPISchema, schema_meta: str | None, schema_id: str | None) weaver.typedefs.OpenAPISchema[source]

Applies the relevant schema references and properties depending on JSON schema/data conversion context.

_deserialize_impl(cstruct: DataT) DataT[source]

Converts the data using validation against the JSON schema definition.

convert_type(cstruct: weaver.typedefs.OpenAPISchema) weaver.typedefs.OpenAPISchema[source]

Converts the node to obtain the JSON schema definition.

abstract static schema_type()[source]
class weaver.wps_restapi.colander_extras.ExtendedSchemaNode(*args, **kwargs)[source]

Base schema node with support of extended functionalities.

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]
_ext_first: Iterable[Type[ExtendedNodeInterface]][source]
_ext_after: Iterable[Type[ExtendedNodeInterface]][source]
abstract static schema_type()[source]
_deserialize_extensions(cstruct: DataT, extensions: Iterable[Type[ExtendedNodeInterface]]) DataT[source]
deserialize(cstruct: DataT) DataT[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.ExpandStringList(*arg, **kw)[source]

Utility that will automatically deserialize a string to its list representation using the validator delimiter.

In order to use this utility, it is important to place it first in the schema node class definition.

class NewNodeSchema(ExpandStringList, ExtendedSchemaNode):
    schema_type = String
    validator = CommaSeparated()
DEFAULT_DELIMITER = ','[source]
abstract static schema_type()[source]
deserialize(cstruct: DataT) DataT[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]

Sequence schema that supports the dropable functionality.

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]

Sequence schema that supports the default value functionality.

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]

Sequence schema that supports all applicable extended schema node functionalities.

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()[source]
class weaver.wps_restapi.colander_extras.DropableMappingSchema(*args, **kwargs)[source]

Mapping schema that supports the dropable functionality.

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]

Mapping schema that supports the default value functionality.

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]

Mapping schema that supports the variable functionality.

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()[source]
class weaver.wps_restapi.colander_extras.StrictMappingSchema(*args, **kwargs)[source]

Object schema that will raise any unknown field not represented by children schema.

This is equivalent to OpenAPI object mapping with additionalProperties: false. This type is useful for defining a dictionary that matches exactly a specific set of values and children schema.

..note::

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 fails validation.

class weaver.wps_restapi.colander_extras.EmptyMappingSchema(*args: Any, **kwargs: Any)[source]

Mapping that guarantees it is completely empty for validation during deserialization.

Any children added to this schema are removed automatically.

class weaver.wps_restapi.colander_extras.PermissiveMappingSchema(*args: Any, **kwargs: Any)[source]

Object schema that will preserve 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.

..note::

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 using preserve are passed down 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.PermissiveSequenceSchema(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

item[source]
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()[source]
get_keyword_items()[source]
_validate_keyword_unique()[source]
_validate_keyword_schemas()[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(cstruct)[source]

Deserialization and validation of a keyword-based schema definition.

This method must be implemented by the specific keyword to handle invalid subnodes according to the behaviour it offers.

_deserialize_subnode(node, cstruct, index)[source]

Deserialization and validation of sub-nodes under a keyword-based schema definition.

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(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
# (each schema must provide the same property name)
class SomeAnimal(OneOfMappingSchema):
    discriminator = "type"
    _one_of = [
        Cat(),
        Dog(),
    ]

# If more specific mapping resolutions than 1-to-1 by name are needed,
# an explicit dictionary can be specified instead.
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).

property discriminator_spec[source]
_keyword_schemas_only_object = False[source]
_keyword = '_one_of'[source]
_discriminator = 'discriminator'[source]
discriminator[source]
abstract classmethod _one_of() Iterable[colander.SchemaNode | Type[colander.SchemaNode]][source]

Sequence of applicable schema nested under the oneOf keyword.

Must be overridden in the schema definition using it.

_deserialize_keyword(cstruct)[source]

Test each possible case, return all corresponding errors if not exactly one of the possibilities is valid.

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() Iterable[colander.SchemaNode | Type[colander.SchemaNode]][source]

Sequence of applicable schema nested under the allOf keyword.

Must be overridden in the schema definition using it.

_deserialize_keyword(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() Iterable[colander.SchemaNode | Type[colander.SchemaNode]][source]

Sequence of applicable schema nested under the anyOf keyword.

Must be overridden in the schema definition using it.

_deserialize_keyword(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.

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() Iterable[colander.SchemaNode | Type[colander.SchemaNode]][source]

Sequence of applicable schema nested under the not keyword.

Must be overridden in the schema definition using it.

_deserialize_keyword(cstruct)[source]

Raise if any sub-node schema that should NOT be present was successfully validated.

class weaver.wps_restapi.colander_extras.SchemaRefConverter(dispatcher)[source]

Converter that will add OpenAPI $schema and $id references if they are provided in the schema node.

convert_type(schema_node: colander.SchemaNode) weaver.typedefs.OpenAPISchema[source]
class weaver.wps_restapi.colander_extras.ExtendedTypeConverter(dispatcher)[source]

Base converter with support of Extended schema type definitions.

convert_type(schema_node: colander.SchemaNode) weaver.typedefs.OpenAPISchema[source]
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(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(schema_node: OneOfKeywordSchema) weaver.typedefs.OpenAPISchemaOneOf[source]
class weaver.wps_restapi.colander_extras.AllOfKeywordTypeConverter(dispatcher)[source]

Object converter that generates the allOf keyword definition.

convert_type(schema_node: colander.SchemaNode) weaver.typedefs.OpenAPISchemaAllOf[source]
class weaver.wps_restapi.colander_extras.AnyOfKeywordTypeConverter(dispatcher)[source]

Object converter that generates the anyOf keyword definition.

convert_type(schema_node: colander.SchemaNode) weaver.typedefs.OpenAPISchemaAnyOf[source]
class weaver.wps_restapi.colander_extras.NotKeywordTypeConverter(dispatcher)[source]

Object converter that generates the not keyword definition.

convert_type(schema_node: colander.SchemaNode) weaver.typedefs.OpenAPISchemaNot[source]
class weaver.wps_restapi.colander_extras.ExtendedObjectTypeConverter(dispatcher)[source]

Object convert for mapping type with extended capabilities.

class weaver.wps_restapi.colander_extras.VariableObjectTypeConverter(dispatcher)[source]

Object convertor with additionalProperties for each properties marked as VariableSchemaNode.

convert_type(schema_node: colander.SchemaNode) weaver.typedefs.OpenAPISchema[source]
class weaver.wps_restapi.colander_extras.DecimalTypeConverter(dispatcher)[source]
format = 'decimal'[source]
convert_type(schema_node)[source]
class weaver.wps_restapi.colander_extras.MoneyTypeConverter(dispatcher)[source]
convert_validator[source]
class weaver.wps_restapi.colander_extras.OAS3TypeConversionDispatcher(custom_converters: Dict[colander.SchemaType, cornice_swagger.converters.schema.TypeConverter] | None = None, default_converter: cornice_swagger.converters.schema.TypeConverter | None = None)[source]
openapi_spec = 3[source]
extend_converters() None[source]

Extend base TypeConverter derived classes to provide additional capabilities seamlessly.

class weaver.wps_restapi.colander_extras.OAS3ParameterConverter[source]
reserved_params = ['name', 'in', 'required', 'allowReserved', 'summary', 'description', 'schema', 'content'][source]
convert(schema_node: colander.SchemaNode, definition_handler: cornice_swagger.swagger.DefinitionHandler) weaver.typedefs.OpenAPISpecParameter[source]

Convert node schema into a parameter object.

class weaver.wps_restapi.colander_extras.OAS3BodyParameterConverter[source]
class weaver.wps_restapi.colander_extras.OAS3PathParameterConverter[source]
class weaver.wps_restapi.colander_extras.OAS3QueryParameterConverter[source]
class weaver.wps_restapi.colander_extras.OAS3HeaderParameterConverter[source]
class weaver.wps_restapi.colander_extras.OAS3CookieParameterConverter[source]
_in = 'cookie'[source]
class weaver.wps_restapi.colander_extras.OAS3ParameterConversionDispatcher(definition_handler)[source]
converters[source]
class weaver.wps_restapi.colander_extras.OAS3DefinitionHandler(ref=0, type_converter=TypeConverter())[source]

Handles Swagger object definitions provided by cornice as colander schemas.

Parameters:

ref – The depth that should be used by self.ref when calling self.from_schema.

json_pointer = '#/components/schemas/'[source]
from_schema(schema_node: colander.SchemaNode, base_name: str | None = None) weaver.typedefs.OpenAPISchema[source]

Convert the schema node to an OAS schema.

If the schema node provided schema_ref URL and that the object is not defined, use it instead as an external reference.

_process_items(schema: Dict[str, Any], list_type: typing_extensions.Literal[oneOf, allOf, anyOf, not], item_list: List[Dict[str, Any]], depth: int, base_name: str) Dict[str, Any][source]

Generates recursive schema definitions with JSON ref pointers for nested keyword objects.

Contrary to the original implementation, preserves additional metadata like the object title, description, etc.

class weaver.wps_restapi.colander_extras.OAS3ParameterHandler(definition_handler=DefinitionHandler(), ref=False, type_converter=TypeConverter(), parameter_converter=ParameterConverter(TypeConverter()))[source]

Handles swagger parameter definitions.

Parameters:
  • definition_handler – Callable that handles swagger definition schemas.

  • ref – Specifies the ref value when calling from_xxx methods.

json_pointer = '#/components/parameters/'[source]
class weaver.wps_restapi.colander_extras.OAS3ResponseHandler(definition_handler=DefinitionHandler(), type_converter=TypeConverter(), ref=False)[source]

Handles swagger response definitions.

Parameters:
  • definition_handler – Callable that handles swagger definition schemas.

  • ref – Specifies the ref value when calling from_xxx methods.

json_pointer = '#/components/responses/'[source]
class weaver.wps_restapi.colander_extras.CorniceOpenAPI(services: Sequence[cornice.Service] | None = None, def_ref_depth: int = 0, param_ref: bool = False, resp_ref: bool = False, pyramid_registry: pyramid.registry.Registry | None = None)[source]

Handles the creation of a swagger document from a cornice application.

Parameters:
  • services – List of cornice services to document. You may use cornice.service.get_services() to get it.

  • def_ref_depth – How depth swagger object schemas should be split into swaggger definitions with JSON pointers. Default (0) is no split. You may use negative values to split everything.

  • param_ref – Defines if swagger parameters should be put inline on the operation or on the parameters section and referenced by JSON pointers. Default is inline.

  • resp_ref – Defines if swagger responses should be put inline on the operation or on the responses section and referenced by JSON pointers. Default is inline.

  • pyramid_registry – Pyramid registry, should be passed if you use pyramid routes instead of service level paths.

openapi_spec = 3[source]
generate(title: str | None = None, version: str | None = None, base_path: str | None = None, info: weaver.typedefs.OpenAPISpecInfo | None = None, swagger: weaver.typedefs.JSON | None = None, openapi_spec: typing_extensions.Literal[2, 3] = 2, **kwargs) weaver.typedefs.OpenAPISpecification[source]

Generate an OpenAPI documentation. Keyword arguments may be used to provide additional information to build methods as such ignores.

Parameters:
  • title – The name presented on the swagger document.

  • version – The version of the API presented on the swagger document.

  • base_path – The path that all requests to the API must refer to.

  • info – Swagger info field.

  • swagger – Extra fields that should be provided on the swagger documentation.

  • openapi_spec – The OpenAPI specification version to use for swagger documentation format.

Return type:

dict

Returns:

Full OpenAPI/Swagger compliant specification for the application.

weaver.wps_restapi.constants
Module Contents
weaver.wps_restapi.constants.Conformance[source]
class weaver.wps_restapi.constants.ConformanceCategory[source]

Constants container that provides similar functionalities to ExtendedEnum without explicit Enum membership.

ALL = 'all'[source]
CONFORMANCE = 'conf'[source]
PERMISSION = 'per'[source]
RECOMMENDATION = 'rec'[source]
REQUIREMENT = 'req'[source]
weaver.wps_restapi.constants.AnyConformanceCategory[source]
weaver.wps_restapi.patches

Helpers to work around some default view configurations that are not desired.

Module Contents
class weaver.wps_restapi.patches.NoAutoHeadList[source]

List that does not allow addition of HTTP HEAD method object references unless allowed once.

Initialize self. See help(type(self)) for accurate signature.

allow_once = False[source]
append(__object: str | Tuple[str, Any, Any]) None[source]

Append object to the end of the list.

class weaver.wps_restapi.patches.ServiceOnlyExplicitGetHead(*_: Any, **__: Any)[source]

Service that disallow the auto-insertion of HTTP HEAD method view when HTTP GET view is defined.

This service overrides the default cornice.Service in order to avoid auto-insertion of HTTP HEAD view. Similarly to pyramid, the view registration assume that HEAD are always wanted when adding GET definitions. Because HEAD view can be added explicitly, the class also detects these cases to let them pass as expected.

Without this patch, all endpoint would otherwise report erroneous HEAD requests in the generated OpenAPI specification once HEAD is removed from cornice_swagger.CorniceSwagger.ignore_methods.

See also

add_view(method: str | Tuple[str], view: Any, **kwargs: Any) None[source]

Add a view to a method and arguments.

All the Service keyword params except name and path can be overwritten here. Additionally, api() has following keyword params:

Parameters:
  • method – The request method. Should be one of ‘GET’, ‘POST’, ‘PUT’, ‘DELETE’, ‘OPTIONS’, ‘TRACE’, or ‘CONNECT’.

  • view – the view to hook to

  • **kwargs

    additional configuration for this view, including permission.

class weaver.wps_restapi.patches.RequestMethodPredicateNoGetHead(val: str | Tuple[str], config: pyramid.config.Configurator)[source]
weaver.wps_restapi.patches.patch_pyramid_view_no_auto_head_get_method(config: pyramid.config.Configurator) None[source]

Replace predicate handlers automatically adding HTTP HEAD route/view when HTTP GET are defined by ones that doesn’t.

weaver.wps_restapi.swagger_definitions

Schema definitions for OpenAPI generation and validation of data from received requests and returned responses.

This module should contain any and every definition in use to build the Swagger UI and the OpenAPI JSON schema so that one can update the specification without touching any other files after the initial integration.

Schemas defined in this module are employed (through deserialize method calls) to validate that data conforms to reported definitions. This makes the documentation of the API better aligned with resulting code execution under it. It also provides a reference point for external users to understand expected data structures with complete schema definitions generated on the exposed endpoints (JSON and Swagger UI).

The definitions are also employed to generate the OpenAPI definitions reported in the documentation published on Weaver’s ReadTheDocs page.

Module Contents
weaver.wps_restapi.swagger_definitions.ViewInfo[source]
weaver.wps_restapi.swagger_definitions.WEAVER_CONFIG_REMOTE_LIST[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.2'[source]
weaver.wps_restapi.swagger_definitions.CWL_REPO_URL = 'https://github.com/common-workflow-language'[source]
weaver.wps_restapi.swagger_definitions.CWL_SCHEMA_BRANCH = '1.2.1_proposed'[source]
weaver.wps_restapi.swagger_definitions.CWL_SCHEMA_PATH = 'json-schema/cwl.yaml'[source]
weaver.wps_restapi.swagger_definitions.CWL_SCHEMA_REPO[source]
weaver.wps_restapi.swagger_definitions.CWL_SCHEMA_URL[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_DOC_BASE_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.OGC_API_SCHEMA_VERSION = 'master'[source]
weaver.wps_restapi.swagger_definitions.OGC_API_SCHEMA_BASE[source]
weaver.wps_restapi.swagger_definitions.OGC_API_SCHEMA_CORE[source]
weaver.wps_restapi.swagger_definitions.OGC_API_EXAMPLES_CORE[source]
weaver.wps_restapi.swagger_definitions.OGC_API_SCHEMA_EXT_DEPLOY[source]
weaver.wps_restapi.swagger_definitions.OGC_API_EXAMPLES_EXT_DEPLOY[source]
weaver.wps_restapi.swagger_definitions.OGC_API_SCHEMA_EXT_BILL[source]
weaver.wps_restapi.swagger_definitions.OGC_API_SCHEMA_EXT_QUOTE[source]
weaver.wps_restapi.swagger_definitions.OGC_API_SCHEMA_EXT_WORKFLOW[source]
weaver.wps_restapi.swagger_definitions.OGC_API_SCHEMAS_URL = 'https://schemas.opengis.net'[source]
weaver.wps_restapi.swagger_definitions.OGC_API_COMMON_PART1_BASE[source]
weaver.wps_restapi.swagger_definitions.OGC_API_COMMON_PART1_SCHEMAS[source]
weaver.wps_restapi.swagger_definitions.OGC_API_PROC_PART1_BASE[source]
weaver.wps_restapi.swagger_definitions.OGC_API_PROC_PART1_SCHEMAS[source]
weaver.wps_restapi.swagger_definitions.OGC_API_PROC_PART1_RESPONSES[source]
weaver.wps_restapi.swagger_definitions.OGC_API_PROC_PART1_PARAMETERS[source]
weaver.wps_restapi.swagger_definitions.OGC_API_PROC_PART1_EXAMPLES[source]
weaver.wps_restapi.swagger_definitions.OGC_WPS_1_SCHEMAS[source]
weaver.wps_restapi.swagger_definitions.OGC_WPS_2_SCHEMAS[source]
weaver.wps_restapi.swagger_definitions.OGC_API_BBOX_SCHEMA[source]
weaver.wps_restapi.swagger_definitions.OGC_API_BBOX_FORMAT = 'ogc-bbox'[source]
weaver.wps_restapi.swagger_definitions.OGC_API_BBOX_EPSG = 'EPSG:4326'[source]
weaver.wps_restapi.swagger_definitions.WEAVER_SCHEMA_VERSION = 'master'[source]
weaver.wps_restapi.swagger_definitions.WEAVER_SCHEMA_URL[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.PROCESS_DESCRIPTION_FIELD_FIRST = ['id', 'title', 'version', 'mutable', 'abstract', 'description', 'keywords', 'metadata',...[source]
weaver.wps_restapi.swagger_definitions.PROCESS_DESCRIPTION_FIELD_AFTER = ['processDescriptionURL', 'processEndpointWPS1', 'executeEndpoint', 'deploymentProfile', 'links'][source]
weaver.wps_restapi.swagger_definitions.PROCESS_DESCRIPTION_FIELD_FIRST_OLD_SCHEMA = ['process'][source]
weaver.wps_restapi.swagger_definitions.PROCESS_DESCRIPTION_FIELD_AFTER_OLD_SCHEMA = ['links'][source]
weaver.wps_restapi.swagger_definitions.PROCESS_IO_FIELD_FIRST = ['id', 'title', 'description', 'minOccurs', 'maxOccurs'][source]
weaver.wps_restapi.swagger_definitions.PROCESS_IO_FIELD_AFTER = ['literalDataDomains', 'formats', 'crs', 'bbox'][source]
weaver.wps_restapi.swagger_definitions.PROCESSES_LISTING_FIELD_FIRST = ['description', 'processes', 'providers'][source]
weaver.wps_restapi.swagger_definitions.PROCESSES_LISTING_FIELD_AFTER = ['page', 'limit', 'count', 'total', 'links'][source]
weaver.wps_restapi.swagger_definitions.PROVIDER_DESCRIPTION_FIELD_FIRST = ['id', 'title', 'version', 'mutable', 'description', 'url', 'type', 'public', 'keywords', 'metadata'][source]
weaver.wps_restapi.swagger_definitions.PROVIDER_DESCRIPTION_FIELD_AFTER = ['links'][source]
weaver.wps_restapi.swagger_definitions.JOBS_LISTING_FIELD_FIRST = ['description', 'jobs', 'groups'][source]
weaver.wps_restapi.swagger_definitions.JOBS_LISTING_FIELD_AFTER = ['page', 'limit', 'count', 'total', 'links'][source]
weaver.wps_restapi.swagger_definitions.QUOTES_LISTING_FIELD_FIRST = ['description', 'quotations'][source]
weaver.wps_restapi.swagger_definitions.QUOTES_LISTING_FIELD_AFTER = ['page', 'limit', 'count', 'total', 'links'][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_STATISTICS = 'Statistics'[source]
weaver.wps_restapi.swagger_definitions.TAG_VAULT = 'Vault'[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.job_stats_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_estimator_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_stats_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_process_package_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_stats_service[source]
weaver.wps_restapi.swagger_definitions.provider_exceptions_service[source]
weaver.wps_restapi.swagger_definitions.provider_execution_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]
weaver.wps_restapi.swagger_definitions.vault_service[source]
weaver.wps_restapi.swagger_definitions.vault_file_service[source]
class weaver.wps_restapi.swagger_definitions.SLUG(*args, **kwargs)[source]

Base schema node with support of extended functionalities.

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[source]
class weaver.wps_restapi.swagger_definitions.Tag(*args, **kwargs)[source]

Base schema node with support of extended functionalities.

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 = 'Identifier with optional tagged version forming a unique reference.'[source]
pattern[source]
class weaver.wps_restapi.swagger_definitions.URL(*args, **kwargs)[source]

Base schema node with support of extended functionalities.

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.Email(*args, **kwargs)[source]

Base schema node with support of extended functionalities.

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 = 'Email recipient.'[source]
format = 'email'[source]
validator[source]
class weaver.wps_restapi.swagger_definitions.MediaType(*args, **kwargs)[source]

Base schema node with support of extended functionalities.

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 = 'IANA identifier of content and format.'[source]
example[source]
pattern[source]
class weaver.wps_restapi.swagger_definitions.QueryBoolean(*_: Any, **__: Any)[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.

Initializes the extended boolean schema node.

When arguments true_choices or false_choices are provided, the corresponding string values are respectively considered as valid truthy/falsy values. Otherwise (default), strict values only of explicit type bool will be considered valid.

When values are specified colander converts them to string lowercase to compare against truthy/falsy values it should accept. For real OpenAPI typing validation, do NOT add other values like "1" to avoid conflict with ExtendedInteger type for schemas that support both variants. If an OpenAPI field is expected to support truthy/falsy values, it is recommended to explicitly define its schema using a oneOf keyword of all relevant schemas it supports, an any applicable validators for explicit values. This is the safest way to ensure the generated OpenAPI schema corresponds to expected type validation.

description = 'Boolean query parameter that allows handles common truthy/falsy values.'[source]
class weaver.wps_restapi.swagger_definitions.DateTimeInterval(*args, **kwargs)[source]

Base schema node with support of extended functionalities.

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[source]
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[source]
regex_interval_closed[source]
regex_interval_open_start[source]
regex_interval_open_end[source]
pattern[source]
class weaver.wps_restapi.swagger_definitions.S3BucketReference(*args, **kwargs)[source]

Base schema node with support of extended functionalities.

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}/[{dirs}/][{file-key}]'"[source]
pattern[source]
class weaver.wps_restapi.swagger_definitions.FileLocal(*args, **kwargs)[source]

Base schema node with support of extended functionalities.

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]
pattern[source]
class weaver.wps_restapi.swagger_definitions.FileURL(*args, **kwargs)[source]

Base schema node with support of extended functionalities.

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.VaultReference(*args, **kwargs)[source]

Base schema node with support of extended functionalities.

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 = 'Vault file reference.'[source]
example = 'vault://399dc5ac-ff66-48d9-9c02-b144a975abe4'[source]
pattern[source]
class weaver.wps_restapi.swagger_definitions.ProcessURL(*args, **kwargs)[source]

Base schema node with support of extended functionalities.

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 = 'Process URL 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.ExecuteReferenceURL(*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]

Base schema node with support of extended functionalities.

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]
pattern[source]
title = 'UUID'[source]
class weaver.wps_restapi.swagger_definitions.AnyIdentifier(*args, **kwargs)[source]

Base schema node with support of extended functionalities.

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.ProcessIdentifierTag(*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 with optional revision tag.'[source]
_schema[source]
_any_of[source]
class weaver.wps_restapi.swagger_definitions.JobID(*args, **kwargs)[source]

Base schema node with support of extended functionalities.

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[source]
description = 'ID of the job.'[source]
example = 'a9d14bf4-84e0-449a-bac8-16e598efe807'[source]
class weaver.wps_restapi.swagger_definitions.Version(*args, **kwargs)[source]

Base schema node with support of extended functionalities.

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]

Base schema node with support of extended functionalities.

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.ContentLengthHeader(*args, **kwargs)[source]

Base schema node with support of extended functionalities.

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-Length'[source]
schema_type[source]
example = '125'[source]
class weaver.wps_restapi.swagger_definitions.ContentDispositionHeader(*args, **kwargs)[source]

Base schema node with support of extended functionalities.

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-Disposition'[source]
schema_type[source]
example = 'attachment; filename=test.json'[source]
class weaver.wps_restapi.swagger_definitions.DateHeader(*args, **kwargs)[source]

Base schema node with support of extended functionalities.

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 = 'Creation date and time of the contents.'[source]
name = 'Date'[source]
schema_type[source]
example = 'Thu, 13 Jan 2022 12:37:19 GMT'[source]
class weaver.wps_restapi.swagger_definitions.LastModifiedHeader(*args, **kwargs)[source]

Base schema node with support of extended functionalities.

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 = 'Modification date and time of the contents.'[source]
name = 'Last-Modified'[source]
schema_type[source]
example = 'Thu, 13 Jan 2022 12:37:19 GMT'[source]
class weaver.wps_restapi.swagger_definitions.AcceptHeader(*args, **kwargs)[source]

Base schema node with support of extended functionalities.

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]

Base schema node with support of extended functionalities.

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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • 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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • 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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

content_type[source]
class weaver.wps_restapi.swagger_definitions.XAuthDockerHeader(*args, **kwargs)[source]

Base schema node with support of extended functionalities.

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

summary = 'Authentication header for private Docker registry access.'[source]
description[source]
name = 'X-Auth-Docker'[source]
example = 'Basic {base64-auth-credentials}'[source]
schema_type[source]
missing[source]
class weaver.wps_restapi.swagger_definitions.RequestContentTypeHeader(*args, **kwargs)[source]

Base schema node with support of extended functionalities.

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

example[source]
default[source]
validator[source]
class weaver.wps_restapi.swagger_definitions.ResponseContentTypeHeader(*args, **kwargs)[source]

Base schema node with support of extended functionalities.

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

example[source]
default[source]
validator[source]
class weaver.wps_restapi.swagger_definitions.RequestHeaders(*args, **kwargs)[source]

Headers that can indicate how to adjust the behavior and/or result to be provided in the response.

accept[source]
accept_language[source]
content_type[source]
class weaver.wps_restapi.swagger_definitions.ResponseHeaders(*args, **kwargs)[source]

Headers describing resulting response.

content_type[source]
class weaver.wps_restapi.swagger_definitions.RedirectHeaders(*args, **kwargs)[source]

Headers describing resulting response.

Location[source]
class weaver.wps_restapi.swagger_definitions.AcceptFormatHeaders(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

accept[source]
accept_language[source]
class weaver.wps_restapi.swagger_definitions.OutputFormatQuery(*args, **kwargs)[source]

Base schema node with support of extended functionalities.

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 = 'Output format selector for requested contents.'[source]
example[source]
validator[source]
class weaver.wps_restapi.swagger_definitions.FormatQueryValue(*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
# (each schema must provide the same property name)
class SomeAnimal(OneOfMappingSchema):
    discriminator = "type"
    _one_of = [
        Cat(),
        Dog(),
    ]

# If more specific mapping resolutions than 1-to-1 by name are needed,
# an explicit dictionary can be specified instead.
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.FormatQuery(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

f[source]
format[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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

description = 'Empty response body.'[source]
default[source]
class weaver.wps_restapi.swagger_definitions.FileUploadHeaders(*args, **kwargs)[source]

Headers that can indicate how to adjust the behavior and/or result to be provided in the response.

content_type[source]
content_length[source]
content_disposition[source]
class weaver.wps_restapi.swagger_definitions.FileUploadContent(*args, **kwargs)[source]

Base schema node with support of extended functionalities.

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 = "Contents of the file being uploaded with multipart. When prefixed with 'Content-Type:..."[source]
class weaver.wps_restapi.swagger_definitions.FileResponseHeaders(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

content_type[source]
content_length[source]
content_disposition[source]
date[source]
last_modified[source]
class weaver.wps_restapi.swagger_definitions.AccessToken(*args, **kwargs)[source]

Base schema node with support of extended functionalities.

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.DescriptionSchema(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

description[source]
class weaver.wps_restapi.swagger_definitions.KeywordList(*args, **kwargs)[source]

Sequence schema that supports all applicable extended schema node functionalities.

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]

Base schema node with support of extended functionalities.

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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • 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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

hreflang[source]
class weaver.wps_restapi.swagger_definitions.LinkHeader(*args, **kwargs)[source]

Base schema node with support of extended functionalities.

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 = '<http://example.com>; rel="relation"; type=text/plain'[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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

role[source]
class weaver.wps_restapi.swagger_definitions.LinkRelationshipType(*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
# (each schema must provide the same property name)
class SomeAnimal(OneOfMappingSchema):
    discriminator = "type"
    _one_of = [
        Cat(),
        Dog(),
    ]

# If more specific mapping resolutions than 1-to-1 by name are needed,
# an explicit dictionary can be specified instead.
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 = 'Link relation as registered or extension type (see...'[source]
_one_of[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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • 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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

href[source]
type[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

_schema[source]
_schema_include_deserialize = False[source]
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.

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]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

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
# (each schema must provide the same property name)
class SomeAnimal(OneOfMappingSchema):
    discriminator = "type"
    _one_of = [
        Cat(),
        Dog(),
    ]

# If more specific mapping resolutions than 1-to-1 by name are needed,
# an explicit dictionary can be specified instead.
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
# (each schema must provide the same property name)
class SomeAnimal(OneOfMappingSchema):
    discriminator = "type"
    _one_of = [
        Cat(),
        Dog(),
    ]

# If more specific mapping resolutions than 1-to-1 by name are needed,
# an explicit dictionary can be specified instead.
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]

Sequence schema that supports all applicable extended schema node functionalities.

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]

Sequence schema that supports all applicable extended schema node functionalities.

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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

_schema[source]
class weaver.wps_restapi.swagger_definitions.FormatSchema(*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
# (each schema must provide the same property name)
class SomeAnimal(OneOfMappingSchema):
    discriminator = "type"
    _one_of = [
        Cat(),
        Dog(),
    ]

# If more specific mapping resolutions than 1-to-1 by name are needed,
# an explicit dictionary can be specified instead.
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]
deserialize(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.swagger_definitions.FormatMimeType(*args, **kwargs)[source]

Used to respect mimeType field to work with pre-existing processes.

mimeType[source]
encoding[source]
schema[source]
class weaver.wps_restapi.swagger_definitions.Format(*args, **kwargs)[source]

Used to respect mediaType field as suggested per OGC-API.

_schema_include_deserialize = False[source]
_schema[source]
mediaType[source]
encoding[source]
schema[source]
class weaver.wps_restapi.swagger_definitions.FormatDefaultMimeType(*args, **kwargs)[source]

Used to respect mimeType field to work with pre-existing processes.

description = 'Format for process input are assumed plain/text if the media-type was omitted and is not one of...'[source]
mimeType[source]
class weaver.wps_restapi.swagger_definitions.FormatDefaultMediaType(*args, **kwargs)[source]

Used to respect mediaType field as suggested per OGC-API.

description = 'Format for process input are assumed plain/text if the media-type was omitted and is not one of...'[source]
mediaType[source]
class weaver.wps_restapi.swagger_definitions.FormatSelection(*args, **kwargs)[source]

Validation against mimeType or mediaType format.

Note

Format are validated to be retro-compatible with pre-existing/deployed/remote processes.

_one_of[source]
class weaver.wps_restapi.swagger_definitions.FormatDescription(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

maximumMegabytes[source]
class weaver.wps_restapi.swagger_definitions.FormatDefault(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

default[source]
class weaver.wps_restapi.swagger_definitions.DescriptionFormat(*args, **kwargs)[source]

Used to respect mediaType field as suggested per OGC-API.

class weaver.wps_restapi.swagger_definitions.DeploymentFormat(*args, **kwargs)[source]

Validation against mimeType or mediaType format.

Note

Format are validated to be retro-compatible with pre-existing/deployed/remote processes.

class weaver.wps_restapi.swagger_definitions.ResultFormat(*args, **kwargs)[source]

Format employed for reference results respecting ‘OGC API - Processes’ schemas.

_schema[source]
_ext_schema_fields = [][source]
mediaType[source]
encoding[source]
schema[source]
class weaver.wps_restapi.swagger_definitions.DescriptionFormatList(*args, **kwargs)[source]

Sequence schema that supports all applicable extended schema node functionalities.

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_item[source]
class weaver.wps_restapi.swagger_definitions.DeploymentFormatList(*args, **kwargs)[source]

Sequence schema that supports all applicable extended schema node functionalities.

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_item[source]
class weaver.wps_restapi.swagger_definitions.AdditionalParameterUnique(*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
# (each schema must provide the same property name)
class SomeAnimal(OneOfMappingSchema):
    discriminator = "type"
    _one_of = [
        Cat(),
        Dog(),
    ]

# If more specific mapping resolutions than 1-to-1 by name are needed,
# an explicit dictionary can be specified instead.
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.AdditionalParameterListing(*args, **kwargs)[source]

Sequence schema that supports all applicable extended schema node functionalities.

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

param[source]
class weaver.wps_restapi.swagger_definitions.AdditionalParameterValues(*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
# (each schema must provide the same property name)
class SomeAnimal(OneOfMappingSchema):
    discriminator = "type"
    _one_of = [
        Cat(),
        Dog(),
    ]

# If more specific mapping resolutions than 1-to-1 by name are needed,
# an explicit dictionary can be specified instead.
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.AdditionalParameterDefinition(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

name[source]
values[source]
class weaver.wps_restapi.swagger_definitions.AdditionalParameterList(*args, **kwargs)[source]

Sequence schema that supports all applicable extended schema node functionalities.

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

param[source]
class weaver.wps_restapi.swagger_definitions.AdditionalParametersMeta(*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
# (each schema must provide the same property name)
class SomeAnimal(OneOfMappingSchema):
    discriminator = "type"
    _one_of = [
        Cat(),
        Dog(),
    ]

# If more specific mapping resolutions than 1-to-1 by name are needed,
# an explicit dictionary can be specified instead.
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.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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • 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]

Sequence schema that supports all applicable extended schema node functionalities.

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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • 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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • 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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • 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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

title[source]
description[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

class weaver.wps_restapi.swagger_definitions.ProcessContext(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • 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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • 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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

class weaver.wps_restapi.swagger_definitions.DeploymentType(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

deprecated = True[source]
abstract[source]
class weaver.wps_restapi.swagger_definitions.DescriptionMeta(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • 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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

keywords[source]
metadata[source]
class weaver.wps_restapi.swagger_definitions.InputOutputDescriptionMeta(*args: Any, **kwargs: Any)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

class weaver.wps_restapi.swagger_definitions.ReferenceOAS(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

_schema[source]
_ref[source]
class weaver.wps_restapi.swagger_definitions.TypeOAS(*args, **kwargs)[source]

Base schema node with support of extended functionalities.

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 = 'type'[source]
schema_type[source]
validator[source]
class weaver.wps_restapi.swagger_definitions.EnumItemOAS(*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
# (each schema must provide the same property name)
class SomeAnimal(OneOfMappingSchema):
    discriminator = "type"
    _one_of = [
        Cat(),
        Dog(),
    ]

# If more specific mapping resolutions than 1-to-1 by name are needed,
# an explicit dictionary can be specified instead.
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.EnumOAS(*args, **kwargs)[source]

Sequence schema that supports all applicable extended schema node functionalities.

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

enum[source]
class weaver.wps_restapi.swagger_definitions.RequiredOAS(*args, **kwargs)[source]

Sequence schema that supports all applicable extended schema node functionalities.

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

required_field[source]
class weaver.wps_restapi.swagger_definitions.MultipleOfOAS(*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
# (each schema must provide the same property name)
class SomeAnimal(OneOfMappingSchema):
    discriminator = "type"
    _one_of = [
        Cat(),
        Dog(),
    ]

# If more specific mapping resolutions than 1-to-1 by name are needed,
# an explicit dictionary can be specified instead.
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.PermissiveDefinitionOAS(*args, **kwargs)[source]

Allows specifying specific schema conditions that fails underlying schema definition validation if present.

Corresponds to the not specifier of OpenAPI specification.

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]
class weaver.wps_restapi.swagger_definitions.PseudoObjectOAS(*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
# (each schema must provide the same property name)
class SomeAnimal(OneOfMappingSchema):
    discriminator = "type"
    _one_of = [
        Cat(),
        Dog(),
    ]

# If more specific mapping resolutions than 1-to-1 by name are needed,
# an explicit dictionary can be specified instead.
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.KeywordObjectOAS(*args, **kwargs)[source]

Sequence schema that supports all applicable extended schema node functionalities.

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.AdditionalPropertiesOAS(*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
# (each schema must provide the same property name)
class SomeAnimal(OneOfMappingSchema):
    discriminator = "type"
    _one_of = [
        Cat(),
        Dog(),
    ]

# If more specific mapping resolutions than 1-to-1 by name are needed,
# an explicit dictionary can be specified instead.
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.AnyValueOAS(*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.PropertyOAS(*args: Any, **kwargs: Any)[source]

Object schema that will preserve 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.

..note::

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 using preserve are passed down without any validation. Other fields that are explicitly specified with sub-schema nodes will still be validated as per usual behaviour.

See also

StrictMappingSchema

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]
_format[source]
default[source]
example[source]
title[source]
description[source]
enum[source]
items[source]
required[source]
nullable[source]
deprecated[source]
read_only[source]
write_only[source]
multiple_of[source]
minimum[source]
maximum[source]
exclusive_min[source]
exclusive_max[source]
min_length[source]
max_length[source]
pattern[source]
min_items[source]
max_items[source]
unique_items[source]
min_prop[source]
max_prop[source]
content_type[source]
content_encode[source]
content_schema[source]
_not_key[source]
_all_of[source]
_any_of[source]
_one_of[source]
x_props[source]
properties[source]
class weaver.wps_restapi.swagger_definitions.AnyPropertyOAS(*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
# (each schema must provide the same property name)
class SomeAnimal(OneOfMappingSchema):
    discriminator = "type"
    _one_of = [
        Cat(),
        Dog(),
    ]

# If more specific mapping resolutions than 1-to-1 by name are needed,
# an explicit dictionary can be specified instead.
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.ObjectPropertiesOAS(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

property_name[source]
class weaver.wps_restapi.swagger_definitions.ObjectOAS(*args, **kwargs)[source]

Allows specifying specific schema conditions that fails underlying schema definition validation if present.

Corresponds to the not specifier of OpenAPI specification.

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]
_type[source]
properties[source]
class weaver.wps_restapi.swagger_definitions.DefinitionOAS(*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.OAS(*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
# (each schema must provide the same property name)
class SomeAnimal(OneOfMappingSchema):
    discriminator = "type"
    _one_of = [
        Cat(),
        Dog(),
    ]

# If more specific mapping resolutions than 1-to-1 by name are needed,
# an explicit dictionary can be specified instead.
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 = 'OpenAPI schema definition.'[source]
_schema = 'http://json-schema.org/draft-07/schema#'[source]
_one_of[source]
class weaver.wps_restapi.swagger_definitions.InputOutputDescriptionSchema(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

schema[source]
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
# (each schema must provide the same property name)
class SomeAnimal(OneOfMappingSchema):
    discriminator = "type"
    _one_of = [
        Cat(),
        Dog(),
    ]

# If more specific mapping resolutions than 1-to-1 by name are needed,
# an explicit dictionary can be specified instead.
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
# (each schema must provide the same property name)
class SomeAnimal(OneOfMappingSchema):
    discriminator = "type"
    _one_of = [
        Cat(),
        Dog(),
    ]

# If more specific mapping resolutions than 1-to-1 by name are needed,
# an explicit dictionary can be specified instead.
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.DescribeMinMaxOccurs(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

minOccurs[source]
maxOccurs[source]
class weaver.wps_restapi.swagger_definitions.DeployMinMaxOccurs(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • 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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

id[source]
version[source]
mutable[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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • 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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

id[source]
class weaver.wps_restapi.swagger_definitions.DescribeWithFormats(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

formats[source]
class weaver.wps_restapi.swagger_definitions.DeployWithFormats(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

formats[source]
class weaver.wps_restapi.swagger_definitions.DescribeComplexInputType(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

class weaver.wps_restapi.swagger_definitions.DeployComplexInputType(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • 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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

crs[source]
default[source]
class weaver.wps_restapi.swagger_definitions.SupportedCRSList(*args, **kwargs)[source]

Sequence schema that supports all applicable extended schema node functionalities.

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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

supportedCRS[source]
class weaver.wps_restapi.swagger_definitions.AnyLiteralType(*args, **kwargs)[source]

Submitted values that correspond to literal data.

_one_of[source]
class weaver.wps_restapi.swagger_definitions.Number(*args, **kwargs)[source]

Represents a literal number, integer or float.

_one_of[source]
class weaver.wps_restapi.swagger_definitions.NumericType(*args, **kwargs)[source]

Represents a numeric-like value.

_one_of[source]
class weaver.wps_restapi.swagger_definitions.DecimalType(*args, **kwargs)[source]

Base schema node with support of extended functionalities.

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]
format = 'decimal'[source]
class weaver.wps_restapi.swagger_definitions.PositiveNumber(*args, **kwargs)[source]

Represents a literal number, integer or float, of positive value.

_any_of[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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • 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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

_schema[source]
_schema_include_deserialize = False[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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

description = 'Type of the literal data representation.'[source]
title = 'DataType'[source]
name[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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

title = 'UnitOfMeasure'[source]
name[source]
uom[source]
class weaver.wps_restapi.swagger_definitions.SupportedUoM(*args, **kwargs)[source]

Sequence schema that supports all applicable extended schema node functionalities.

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 supported units for the represented measurement.'[source]
uom_item[source]
validator[source]
class weaver.wps_restapi.swagger_definitions.MeasurementDataDomain(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

supported[source]
default[source]
class weaver.wps_restapi.swagger_definitions.AllowedValuesList(*args, **kwargs)[source]

Sequence schema that supports all applicable extended schema node functionalities.

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.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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

minimumValue[source]
maximumValue[source]
spacing[source]
rangeClosure[source]
class weaver.wps_restapi.swagger_definitions.AllowedRangesList(*args, **kwargs)[source]

Sequence schema that supports all applicable extended schema node functionalities.

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

range[source]
class weaver.wps_restapi.swagger_definitions.AllowedValues(*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
# (each schema must provide the same property name)
class SomeAnimal(OneOfMappingSchema):
    discriminator = "type"
    _one_of = [
        Cat(),
        Dog(),
    ]

# If more specific mapping resolutions than 1-to-1 by name are needed,
# an explicit dictionary can be specified instead.
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.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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

anyValue[source]
class weaver.wps_restapi.swagger_definitions.ValuesReference(*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 = 'URL where to retrieve applicable values.'[source]
class weaver.wps_restapi.swagger_definitions.ArrayLiteralType(*args, **kwargs)[source]

Sequence schema that supports all applicable extended schema node functionalities.

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_item[source]
class weaver.wps_restapi.swagger_definitions.ArrayLiteralDataType(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

data[source]
class weaver.wps_restapi.swagger_definitions.ArrayLiteralValueType(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

value[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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • 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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • 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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

default[source]
class weaver.wps_restapi.swagger_definitions.LiteralDataValueDefinition(*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
# (each schema must provide the same property name)
class SomeAnimal(OneOfMappingSchema):
    discriminator = "type"
    _one_of = [
        Cat(),
        Dog(),
    ]

# If more specific mapping resolutions than 1-to-1 by name are needed,
# an explicit dictionary can be specified instead.
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.LiteralDataDomain(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

default[source]
defaultValue[source]
dataType[source]
valueDefinition[source]
uoms[source]
class weaver.wps_restapi.swagger_definitions.LiteralDataDomainList(*args, **kwargs)[source]

Constraints that apply to the literal data values.

literalDataDomain[source]
class weaver.wps_restapi.swagger_definitions.LiteralDataType(*args, **kwargs)[source]

Allows specifying specific schema conditions that fails underlying schema definition validation if present.

Corresponds to the not specifier of OpenAPI specification.

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

literalDataDomains[source]
_not[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.

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

class weaver.wps_restapi.swagger_definitions.DescribeInputTypeDefinition(*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
# (each schema must provide the same property name)
class SomeAnimal(OneOfMappingSchema):
    discriminator = "type"
    _one_of = [
        Cat(),
        Dog(),
    ]

# If more specific mapping resolutions than 1-to-1 by name are needed,
# an explicit dictionary can be specified instead.
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.DeployInputTypeDefinition(*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
# (each schema must provide the same property name)
class SomeAnimal(OneOfMappingSchema):
    discriminator = "type"
    _one_of = [
        Cat(),
        Dog(),
    ]

# If more specific mapping resolutions than 1-to-1 by name are needed,
# an explicit dictionary can be specified instead.
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.DescribeInputType(*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]
_sort_first[source]
_sort_after[source]
class weaver.wps_restapi.swagger_definitions.DescribeInputTypeWithID(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

title = 'DescribeInputTypeWithID'[source]
class weaver.wps_restapi.swagger_definitions.DeployInputType(*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]
_sort_first[source]
_sort_after[source]
class weaver.wps_restapi.swagger_definitions.DeployInputTypeWithID(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

class weaver.wps_restapi.swagger_definitions.DescribeInputTypeList(*args, **kwargs)[source]

Listing of process inputs descriptions.

input[source]
class weaver.wps_restapi.swagger_definitions.DescribeInputTypeMap(*args: Any, **kwargs: Any)[source]

Description of all process inputs under mapping.

input_id[source]
class weaver.wps_restapi.swagger_definitions.DeployInputTypeList(*args, **kwargs)[source]

Listing of process input definitions to deploy.

input_item[source]
class weaver.wps_restapi.swagger_definitions.DeployInputTypeMap(*args: Any, **kwargs: Any)[source]

Definition of all process inputs under mapping.

input_id[source]
class weaver.wps_restapi.swagger_definitions.DeployInputTypeAny(*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
# (each schema must provide the same property name)
class SomeAnimal(OneOfMappingSchema):
    discriminator = "type"
    _one_of = [
        Cat(),
        Dog(),
    ]

# If more specific mapping resolutions than 1-to-1 by name are needed,
# an explicit dictionary can be specified instead.
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.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.

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

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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

supportedCRS[source]
class weaver.wps_restapi.swagger_definitions.DescribeComplexOutputType(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

class weaver.wps_restapi.swagger_definitions.DeployComplexOutputType(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

class weaver.wps_restapi.swagger_definitions.DescribeOutputTypeDefinition(*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
# (each schema must provide the same property name)
class SomeAnimal(OneOfMappingSchema):
    discriminator = "type"
    _one_of = [
        Cat(),
        Dog(),
    ]

# If more specific mapping resolutions than 1-to-1 by name are needed,
# an explicit dictionary can be specified instead.
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.DeployOutputTypeDefinition(*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
# (each schema must provide the same property name)
class SomeAnimal(OneOfMappingSchema):
    discriminator = "type"
    _one_of = [
        Cat(),
        Dog(),
    ]

# If more specific mapping resolutions than 1-to-1 by name are needed,
# an explicit dictionary can be specified instead.
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.DescribeOutputType(*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]
_sort_first[source]
_sort_after[source]
class weaver.wps_restapi.swagger_definitions.DescribeOutputTypeWithID(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

class weaver.wps_restapi.swagger_definitions.DescribeOutputTypeList(*args, **kwargs)[source]

Listing of process outputs descriptions.

output[source]
class weaver.wps_restapi.swagger_definitions.DescribeOutputTypeMap(*args: Any, **kwargs: Any)[source]

Definition of all process outputs under mapping.

output_id[source]
class weaver.wps_restapi.swagger_definitions.DeployOutputType(*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]
_sort_first[source]
_sort_after[source]
class weaver.wps_restapi.swagger_definitions.DeployOutputTypeWithID(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

class weaver.wps_restapi.swagger_definitions.DeployOutputTypeList(*args, **kwargs)[source]

Listing of process output definitions to deploy.

input[source]
class weaver.wps_restapi.swagger_definitions.DeployOutputTypeMap(*args: Any, **kwargs: Any)[source]

Definition of all process outputs under mapping.

input_id[source]
class weaver.wps_restapi.swagger_definitions.DeployOutputTypeAny(*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
# (each schema must provide the same property name)
class SomeAnimal(OneOfMappingSchema):
    discriminator = "type"
    _one_of = [
        Cat(),
        Dog(),
    ]

# If more specific mapping resolutions than 1-to-1 by name are needed,
# an explicit dictionary can be specified instead.
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.JobExecuteModeEnum(*args, **kwargs)[source]

Base schema node with support of extended functionalities.

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]

Base schema node with support of extended functionalities.

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[source]
schema_type[source]
title = 'JobControlOptions'[source]
default[source]
example[source]
validator[source]
class weaver.wps_restapi.swagger_definitions.JobResponseOptionsEnum(*args, **kwargs)[source]

Base schema node with support of extended functionalities.

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]

Base schema node with support of extended functionalities.

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[source]
schema_type[source]
title = 'TransmissionMode'[source]
default[source]
example[source]
validator[source]
class weaver.wps_restapi.swagger_definitions.JobStatusEnum(*args, **kwargs)[source]

Base schema node with support of extended functionalities.

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[source]
schema_type[source]
title = 'JobStatus'[source]
default[source]
example[source]
validator[source]
class weaver.wps_restapi.swagger_definitions.JobStatusSearchEnum(*args, **kwargs)[source]

Base schema node with support of extended functionalities.

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 = 'JobStatusSearch'[source]
default[source]
example[source]
validator[source]
class weaver.wps_restapi.swagger_definitions.JobTypeEnum(*args, **kwargs)[source]

Base schema node with support of extended functionalities.

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[source]
schema_type[source]
title = 'JobType'[source]
default[source]
example = 'process'[source]
validator[source]
class weaver.wps_restapi.swagger_definitions.JobSortEnum(*args, **kwargs)[source]

Base schema node with support of extended functionalities.

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.ProcessSortEnum(*args, **kwargs)[source]

Base schema node with support of extended functionalities.

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 = 'ProcessSortMethod'[source]
default[source]
example[source]
validator[source]
class weaver.wps_restapi.swagger_definitions.QuoteSortEnum(*args, **kwargs)[source]

Base schema node with support of extended functionalities.

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.JobTagsCommaSeparated(*arg, **kw)[source]

Utility that will automatically deserialize a string to its list representation using the validator delimiter.

See also

  • CommaSeparated

  • StringOneOf

In order to use this utility, it is important to place it first in the schema node class definition.

class NewNodeSchema(ExpandStringList, ExtendedSchemaNode):
    schema_type = String
    validator = CommaSeparated()
schema_type[source]
validator[source]
default[source]
missing[source]
description[source]
class weaver.wps_restapi.swagger_definitions.JobGroupsCommaSeparated(*arg, **kw)[source]

Utility that will automatically deserialize a string to its list representation using the validator delimiter.

See also

  • CommaSeparated

  • StringOneOf

In order to use this utility, it is important to place it first in the schema node class definition.

class NewNodeSchema(ExpandStringList, ExtendedSchemaNode):
    schema_type = String
    validator = CommaSeparated()
schema_type[source]
default[source]
example = 'process,service'[source]
missing[source]
description = 'Comma-separated list of grouping fields with which to list jobs.'[source]
validator[source]
class weaver.wps_restapi.swagger_definitions.JobExecuteSubscribers(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

_schema[source]
description = 'Optional URIs for callbacks for this job.'[source]
success_uri[source]
failure_uri[source]
started_uri[source]
success_email[source]
failure_email[source]
started_email[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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

tags[source]
class weaver.wps_restapi.swagger_definitions.VisibilityValue(*args, **kwargs)[source]

Base schema node with support of extended functionalities.

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]

Base schema node with support of extended functionalities.

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.VisibilitySchema(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

value[source]
class weaver.wps_restapi.swagger_definitions.QuoteEstimatorConfigurationSchema(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

_schema[source]
description = 'Quote Estimator Configuration'[source]
deserialize(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.swagger_definitions.QuoteEstimatorWeightedParameterSchema(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

weight[source]
class weaver.wps_restapi.swagger_definitions.QuoteEstimatorInputParametersSchema(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

description = 'Parametrization of inputs for quote estimation.'[source]
input_id[source]
class weaver.wps_restapi.swagger_definitions.QuoteEstimatorOutputParametersSchema(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

description = 'Parametrization of outputs for quote estimation.'[source]
output_id[source]
class weaver.wps_restapi.swagger_definitions.QuoteEstimatorSchema(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

_schema[source]
description = 'Configuration of the quote estimation algorithm for a given process.'[source]
config[source]
inputs[source]
outputs[source]
class weaver.wps_restapi.swagger_definitions.LocalProcessQuery(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

version[source]
class weaver.wps_restapi.swagger_definitions.LocalProcessPath(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • 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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

provider_id[source]
class weaver.wps_restapi.swagger_definitions.ProviderProcessPath(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

process_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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • 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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • 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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • 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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • 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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • 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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

header[source]
class weaver.wps_restapi.swagger_definitions.ConformanceQueries(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

category[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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

header[source]
querystring[source]
class weaver.wps_restapi.swagger_definitions.OpenAPIAcceptHeader(*args, **kwargs)[source]

Base schema node with support of extended functionalities.

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

default[source]
validator[source]
class weaver.wps_restapi.swagger_definitions.OpenAPIRequestHeaders(*args, **kwargs)[source]

Headers that can indicate how to adjust the behavior and/or result to be provided in the response.

accept[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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • 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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • 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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • 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 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 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 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]

Base schema node with support of extended functionalities.

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]

Base schema node with support of extended functionalities.

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]

Base schema node with support of extended functionalities.

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]

Base schema node with support of extended functionalities.

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]

Sequence schema that supports all applicable extended schema node functionalities.

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]

Base schema node with support of extended functionalities.

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]

Base schema node with support of extended functionalities.

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]

Base schema node with support of extended functionalities.

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]

Base schema node with support of extended functionalities.

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]

Base schema node with support of extended functionalities.

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]

Base schema node with support of extended functionalities.

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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • 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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • 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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

_schema[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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

_schema[source]
name = 'GetCapabilities'[source]
title = 'GetCapabilities'[source]
class weaver.wps_restapi.swagger_definitions.OWSIdentifier(*args, **kwargs)[source]

Base schema node with support of extended functionalities.

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]

Sequence schema that supports all applicable extended schema node functionalities.

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]

Base schema node with support of extended functionalities.

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]

Base schema node with support of extended functionalities.

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]

Base schema node with support of extended functionalities.

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]

Sequence schema that supports all applicable extended schema node functionalities.

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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

_schema[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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • 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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

_schema[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
# (each schema must provide the same property name)
class SomeAnimal(OneOfMappingSchema):
    discriminator = "type"
    _one_of = [
        Cat(),
        Dog(),
    ]

# If more specific mapping resolutions than 1-to-1 by name are needed,
# an explicit dictionary can be specified instead.
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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • 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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • 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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

header[source]
body[source]
class weaver.wps_restapi.swagger_definitions.XMLBooleanAttribute(*args, **kwargs)[source]

Base schema node with support of extended functionalities.

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]

Base schema node with support of extended functionalities.

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]

Base schema node with support of extended functionalities.

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]

Sequence schema that supports all applicable extended schema node functionalities.

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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • 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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • 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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • 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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • 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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • 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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • 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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

_schema[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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • 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]

Base schema node with support of extended functionalities.

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]

Base schema node with support of extended functionalities.

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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • 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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • 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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • 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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

name[source]
dcp[source]
class weaver.wps_restapi.swagger_definitions.OperationsMetadata(*args, **kwargs)[source]

Sequence schema that supports all applicable extended schema node functionalities.

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]

Base schema node with support of extended functionalities.

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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

version[source]
identifier[source]
_title[source]
abstract[source]
class weaver.wps_restapi.swagger_definitions.WPSProcessOfferings(*args, **kwargs)[source]

Sequence schema that supports all applicable extended schema node functionalities.

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]

Sequence schema that supports all applicable extended schema node functionalities.

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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

name = 'Languages'[source]
title = 'Languages'[source]
default[source]
supported[source]
class weaver.wps_restapi.swagger_definitions.WPSResponseBaseType(*args: Any, **kwargs: Any)[source]

Object schema that will preserve 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.

..note::

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 using preserve are passed down without any validation. Other fields that are explicitly specified with sub-schema nodes will still be validated as per usual behaviour.

See also

StrictMappingSchema

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[source]
service[source]
version[source]
lang[source]
class weaver.wps_restapi.swagger_definitions.WPSProcessVersion(*args, **kwargs)[source]

Base schema node with support of extended functionalities.

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[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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • 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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • 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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • 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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

crs[source]
class weaver.wps_restapi.swagger_definitions.WPSSupportedCRS(*args, **kwargs)[source]

Sequence schema that supports all applicable extended schema node functionalities.

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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • 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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • 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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • 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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

name = 'Format'[source]
format_item[source]
class weaver.wps_restapi.swagger_definitions.WPSFormatList(*args, **kwargs)[source]

Sequence schema that supports all applicable extended schema node functionalities.

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_item[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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • 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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • 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
# (each schema must provide the same property name)
class SomeAnimal(OneOfMappingSchema):
    discriminator = "type"
    _one_of = [
        Cat(),
        Dog(),
    ]

# If more specific mapping resolutions than 1-to-1 by name are needed,
# an explicit dictionary can be specified instead.
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
# (each schema must provide the same property name)
class SomeAnimal(OneOfMappingSchema):
    discriminator = "type"
    _one_of = [
        Cat(),
        Dog(),
    ]

# If more specific mapping resolutions than 1-to-1 by name are needed,
# an explicit dictionary can be specified instead.
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
# (each schema must provide the same property name)
class SomeAnimal(OneOfMappingSchema):
    discriminator = "type"
    _one_of = [
        Cat(),
        Dog(),
    ]

# If more specific mapping resolutions than 1-to-1 by name are needed,
# an explicit dictionary can be specified instead.
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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • 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]

Sequence schema that supports all applicable extended schema node functionalities.

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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • 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]

Sequence schema that supports all applicable extended schema node functionalities.

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: Any, **kwargs: Any)[source]

Object schema that will preserve 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.

..note::

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 using preserve are passed down without any validation. Other fields that are explicitly specified with sub-schema nodes will still be validated as per usual behaviour.

See also

StrictMappingSchema

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[source]
name = 'Capabilities'[source]
title = 'Capabilities'[source]
svc[source]
ops[source]
offering[source]
languages[source]
class weaver.wps_restapi.swagger_definitions.WPSProcessDescriptionType(*args: Any, **kwargs: Any)[source]

Object schema that will preserve 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.

..note::

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 using preserve are passed down without any validation. Other fields that are explicitly specified with sub-schema nodes will still be validated as per usual behaviour.

See also

StrictMappingSchema

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]

Sequence schema that supports all applicable extended schema node functionalities.

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: Any, **kwargs: Any)[source]

Object schema that will preserve 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.

..note::

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 using preserve are passed down without any validation. Other fields that are explicitly specified with sub-schema nodes will still be validated as per usual behaviour.

See also

StrictMappingSchema

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[source]
name = 'DescribeProcess'[source]
title = 'DescribeProcess'[source]
process[source]
class weaver.wps_restapi.swagger_definitions.WPSStatusLocationAttribute(*args, **kwargs)[source]

Base schema node with support of extended functionalities.

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]

Base schema node with support of extended functionalities.

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]

Base schema node with support of extended functionalities.

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]

Base schema node with support of extended functionalities.

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]

Base schema node with support of extended functionalities.

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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • 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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • 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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • 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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

name = 'Output'[source]
title = 'OutputDefinition'[source]
class weaver.wps_restapi.swagger_definitions.WPSOutputDefinitions(*args, **kwargs)[source]

Sequence schema that supports all applicable extended schema node functionalities.

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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • 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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • 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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • 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
# (each schema must provide the same property name)
class SomeAnimal(OneOfMappingSchema):
    discriminator = "type"
    _one_of = [
        Cat(),
        Dog(),
    ]

# If more specific mapping resolutions than 1-to-1 by name are needed,
# an explicit dictionary can be specified instead.
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]

Sequence schema that supports all applicable extended schema node functionalities.

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: Any, **kwargs: Any)[source]

Object schema that will preserve 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.

..note::

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 using preserve are passed down without any validation. Other fields that are explicitly specified with sub-schema nodes will still be validated as per usual behaviour.

See also

StrictMappingSchema

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[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
# (each schema must provide the same property name)
class SomeAnimal(OneOfMappingSchema):
    discriminator = "type"
    _one_of = [
        Cat(),
        Dog(),
    ]

# If more specific mapping resolutions than 1-to-1 by name are needed,
# an explicit dictionary can be specified instead.
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]

Base schema node with support of extended functionalities.

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]

Base schema node with support of extended functionalities.

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]

Base schema node with support of extended functionalities.

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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • 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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • 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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • 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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • 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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • 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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

header[source]
class weaver.wps_restapi.swagger_definitions.ProcessDescriptionQuery(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

schema[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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

header[source]
querystring[source]
class weaver.wps_restapi.swagger_definitions.LocalProcessDescriptionQuery(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

class weaver.wps_restapi.swagger_definitions.LocalProcessEndpointHeaders(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

header[source]
querystring[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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

header[source]
querystring[source]
class weaver.wps_restapi.swagger_definitions.ProviderProcessPackageEndpoint(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

header[source]
querystring[source]
class weaver.wps_restapi.swagger_definitions.ProcessQuoteEstimatorGetEndpoint(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

header[source]
querystring[source]
class weaver.wps_restapi.swagger_definitions.ProcessQuoteEstimatorPutEndpoint(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

header[source]
querystring[source]
body[source]
class weaver.wps_restapi.swagger_definitions.ProcessQuoteEstimatorDeleteEndpoint(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

header[source]
querystring[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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

header[source]
querystring[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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

header[source]
querystring[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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • 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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • 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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • 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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

header[source]
class weaver.wps_restapi.swagger_definitions.JobInputsOutputsQuery(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

schema[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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

header[source]
querystring[source]
class weaver.wps_restapi.swagger_definitions.JobResultsQuery(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

schema[source]
class weaver.wps_restapi.swagger_definitions.LocalProcessJobResultsQuery(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

header[source]
querystring[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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

header[source]
querystring[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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

header[source]
querystring[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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • 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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • 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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • 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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • 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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • 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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • 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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • 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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • 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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

header[source]
querystring[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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • 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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • 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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

header[source]
querystring[source]
class weaver.wps_restapi.swagger_definitions.JobStatisticsEndpoint(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

header[source]
class weaver.wps_restapi.swagger_definitions.ProcessJobStatisticsEndpoint(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

header[source]
querystring[source]
class weaver.wps_restapi.swagger_definitions.ProviderJobStatisticsEndpoint(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

header[source]
class weaver.wps_restapi.swagger_definitions.ProviderPublic(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

public[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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

id[source]
url[source]
class weaver.wps_restapi.swagger_definitions.ExecuteInputDataType(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

class weaver.wps_restapi.swagger_definitions.ExecuteOutputDataType(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

class weaver.wps_restapi.swagger_definitions.ExecuteOutputDefinition(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

transmissionMode[source]
format[source]
class weaver.wps_restapi.swagger_definitions.ExecuteOutputItem(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

class weaver.wps_restapi.swagger_definitions.ExecuteOutputSpecList(*args, **kwargs)[source]

Filter list of outputs to be obtained from execution and their reporting method.

output[source]
class weaver.wps_restapi.swagger_definitions.ExecuteOutputMapAdditionalProperties(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

output_id[source]
class weaver.wps_restapi.swagger_definitions.ExecuteOutputSpecMap(*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.ExecuteOutputSpec(*args, **kwargs)[source]

Filter list of outputs to be obtained from execution and define their reporting method.

_one_of[source]
class weaver.wps_restapi.swagger_definitions.ProviderNameSchema(*args, **kwargs)[source]

Base schema node with support of extended functionalities.

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

title = 'ProviderName'[source]
description = 'Identifier of the remote provider.'[source]
class weaver.wps_restapi.swagger_definitions.ProviderSummarySchema(*args, **kwargs)[source]

Service provider summary definition.

id[source]
url[source]
type[source]
_schema_meta_include = True[source]
_sort_first[source]
_sort_after[source]
class weaver.wps_restapi.swagger_definitions.ProviderCapabilitiesSchema(*args, **kwargs)[source]

Service provider detailed capabilities.

class weaver.wps_restapi.swagger_definitions.TransmissionModeList(*args, **kwargs)[source]

Sequence schema that supports all applicable extended schema node functionalities.

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]

Sequence schema that supports all applicable extended schema node functionalities.

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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

code[source]
description[source]
class weaver.wps_restapi.swagger_definitions.ProcessControl(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

jobControlOptions[source]
outputTransmission[source]
class weaver.wps_restapi.swagger_definitions.ProcessLocations(*args, **kwargs)[source]

Additional endpoint locations specific to the process.

processDescriptionURL[source]
processEndpointWPS1[source]
executeEndpoint[source]
class weaver.wps_restapi.swagger_definitions.ProcessSummary(*args, **kwargs)[source]

Summary process definition.

_schema[source]
_sort_first[source]
_sort_after[source]
class weaver.wps_restapi.swagger_definitions.ProcessSummaryList(*args, **kwargs)[source]

Sequence schema that supports all applicable extended schema node functionalities.

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

summary[source]
class weaver.wps_restapi.swagger_definitions.ProcessNamesList(*args, **kwargs)[source]

Sequence schema that supports all applicable extended schema node functionalities.

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

process_name[source]
class weaver.wps_restapi.swagger_definitions.ProcessListing(*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
# (each schema must provide the same property name)
class SomeAnimal(OneOfMappingSchema):
    discriminator = "type"
    _one_of = [
        Cat(),
        Dog(),
    ]

# If more specific mapping resolutions than 1-to-1 by name are needed,
# an explicit dictionary can be specified instead.
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.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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

processes[source]
class weaver.wps_restapi.swagger_definitions.ProcessPagingQuery(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

sort[source]
page[source]
limit[source]
class weaver.wps_restapi.swagger_definitions.ProcessVisibility(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

visibility[source]
class weaver.wps_restapi.swagger_definitions.ProcessDeploymentProfile(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

deploymentProfile[source]
class weaver.wps_restapi.swagger_definitions.Process(*args, **kwargs)[source]

Old nested process schema for process description.

inputs[source]
outputs[source]
_sort_first[source]
_sort_after[source]
class weaver.wps_restapi.swagger_definitions.ProcessDescriptionOLD(*args, **kwargs)[source]

Old schema for process description.

deprecated = True[source]
process[source]
_sort_first[source]
_sort_after[source]
class weaver.wps_restapi.swagger_definitions.ProcessDescriptionOGC(*args, **kwargs)[source]

OGC-API schema for process description.

inputs[source]
outputs[source]
_schema[source]
_sort_first[source]
_sort_after[source]
class weaver.wps_restapi.swagger_definitions.ProcessDescription(*args, **kwargs)[source]

Supported schema representations of a process description (based on specified query parameters).

_one_of[source]
class weaver.wps_restapi.swagger_definitions.ProcessDeployment(*args, **kwargs)[source]

Summary process definition.

id[source]
abstract[source]
inputs[source]
outputs[source]
visibility[source]
_schema[source]
_sort_first[source]
_sort_after[source]
class weaver.wps_restapi.swagger_definitions.Duration(*args, **kwargs)[source]

Base schema node with support of extended functionalities.

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 = 'Human-readable representation of the duration.'[source]
example = 'hh:mm:ss'[source]
class weaver.wps_restapi.swagger_definitions.DurationISO(*args, **kwargs)[source]

Duration represented using ISO-8601 format.

schema_type[source]
description = 'ISO-8601 representation of the duration.'[source]
example = 'P[n]Y[n]M[n]DT[n]H[n]M[n]S'[source]
format = 'duration'[source]
deserialize(cstruct: datetime.timedelta | str) str[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.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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

_schema[source]
jobID[source]
processID[source]
providerID[source]
type[source]
status[source]
message[source]
created[source]
started[source]
finished[source]
updated[source]
duration[source]
runningDuration[source]
runningSeconds[source]
expirationDate[source]
estimatedCompletion[source]
nextPoll[source]
percentCompleted[source]
progress[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
# (each schema must provide the same property name)
class SomeAnimal(OneOfMappingSchema):
    discriminator = "type"
    _one_of = [
        Cat(),
        Dog(),
    ]

# If more specific mapping resolutions than 1-to-1 by name are needed,
# an explicit dictionary can be specified instead.
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]

Sequence schema that supports all applicable extended schema node functionalities.

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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

jobID[source]
processID[source]
providerID[source]
status[source]
location[source]
class weaver.wps_restapi.swagger_definitions.PagingBodySchema(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

count[source]
limit[source]
page[source]
total[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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

_schema[source]
jobs[source]
class weaver.wps_restapi.swagger_definitions.JobCategoryFilters(*args: Any, **kwargs: Any)[source]

Object schema that will preserve 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.

..note::

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 using preserve are passed down without any validation. Other fields that are explicitly specified with sub-schema nodes will still be validated as per usual behaviour.

See also

StrictMappingSchema

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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

category[source]
jobs[source]
count[source]
class weaver.wps_restapi.swagger_definitions.GroupedCategoryJobsSchema(*args, **kwargs)[source]

Sequence schema that supports all applicable extended schema node functionalities.

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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • 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
# (each schema must provide the same property name)
class SomeAnimal(OneOfMappingSchema):
    discriminator = "type"
    _one_of = [
        Cat(),
        Dog(),
    ]

# If more specific mapping resolutions than 1-to-1 by name are needed,
# an explicit dictionary can be specified instead.
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]
_sort_first[source]
_sort_after[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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

status[source]
jobID[source]
message[source]
percentCompleted[source]
class weaver.wps_restapi.swagger_definitions.DataEncodingAttributes(*args, **kwargs)[source]

Validation against mimeType or mediaType format.

Note

Format are validated to be retro-compatible with pre-existing/deployed/remote processes.

class weaver.wps_restapi.swagger_definitions.ReferenceBase(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

format[source]
body[source]
bodyReference[source]
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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

title = 'Reference'[source]
href[source]
class weaver.wps_restapi.swagger_definitions.ExecuteReference(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

title = 'ExecuteReference'[source]
href[source]
class weaver.wps_restapi.swagger_definitions.ArrayReference(*args, **kwargs)[source]

Sequence schema that supports all applicable extended schema node functionalities.

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.ArrayReferenceValueType(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

value[source]
class weaver.wps_restapi.swagger_definitions.ExecuteInputAnyType(*args, **kwargs)[source]

Permissive variants that we attempt to parse automatically.

_one_of[source]
class weaver.wps_restapi.swagger_definitions.ExecuteInputItem(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

description = "Default value to be looked for uses key 'value' to conform to older drafts of OGC-API standard...."[source]
class weaver.wps_restapi.swagger_definitions.ExecuteInputListValues(*args, **kwargs)[source]

Sequence schema that supports all applicable extended schema node functionalities.

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_item[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

_schema[source]
href[source]
type[source]
rel[source]
schema[source]
class weaver.wps_restapi.swagger_definitions.ExecuteInputReference(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

summary = 'Execute input reference link definition with parameters.'[source]
class weaver.wps_restapi.swagger_definitions.ExecuteInputFile(*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

title = 'ExecuteInputFile'[source]
_any_of[source]
class weaver.wps_restapi.swagger_definitions.ExecuteInputInlineLiteral(*args, **kwargs)[source]

Submitted values that correspond to literal data.

title = 'ExecuteInputInlineLiteral'[source]
description = 'Execute input literal value provided inline.'[source]
class weaver.wps_restapi.swagger_definitions.BoundingBox2D(*args, **kwargs)[source]

Sequence schema that supports all applicable extended schema node functionalities.

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 = 'Bounding Box using 2D points.'[source]
item[source]
validator[source]
class weaver.wps_restapi.swagger_definitions.BoundingBox3D(*args, **kwargs)[source]

Sequence schema that supports all applicable extended schema node functionalities.

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 = 'Bounding Box using 3D points.'[source]
item[source]
validator[source]
class weaver.wps_restapi.swagger_definitions.BoundingBoxValue(*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
# (each schema must provide the same property name)
class SomeAnimal(OneOfMappingSchema):
    discriminator = "type"
    _one_of = [
        Cat(),
        Dog(),
    ]

# If more specific mapping resolutions than 1-to-1 by name are needed,
# an explicit dictionary can be specified instead.
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.BoundingBoxObject(*args, **kwargs)[source]

Object schema that will raise any unknown field not represented by children schema.

This is equivalent to OpenAPI object mapping with additionalProperties: false. This type is useful for defining a dictionary that matches exactly a specific set of values and children schema.

..note::

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 fails validation.

See also

PermissiveMappingSchema

_schema[source]
description = 'Execute bounding box value provided inline.'[source]
format[source]
bbox[source]
crs[source]
class weaver.wps_restapi.swagger_definitions.ExecuteInputInlineBoundingBox(*args, **kwargs)[source]

Object schema that will raise any unknown field not represented by children schema.

This is equivalent to OpenAPI object mapping with additionalProperties: false. This type is useful for defining a dictionary that matches exactly a specific set of values and children schema.

..note::

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 fails validation.

See also

PermissiveMappingSchema

_schema_include_deserialize = True[source]
class weaver.wps_restapi.swagger_definitions.ExecuteInputInlineValue(*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
# (each schema must provide the same property name)
class SomeAnimal(OneOfMappingSchema):
    discriminator = "type"
    _one_of = [
        Cat(),
        Dog(),
    ]

# If more specific mapping resolutions than 1-to-1 by name are needed,
# an explicit dictionary can be specified instead.
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[source]
_one_of[source]
class weaver.wps_restapi.swagger_definitions.ExecuteInputMeasurement(*args, **kwargs)[source]

Object schema that will raise any unknown field not represented by children schema.

This is equivalent to OpenAPI object mapping with additionalProperties: false. This type is useful for defining a dictionary that matches exactly a specific set of values and children schema.

..note::

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 fails validation.

See also

PermissiveMappingSchema

description = 'Execute measurement value with a unit of measure.'[source]
measurement[source]
uom[source]
reference[source]
class weaver.wps_restapi.swagger_definitions.ExecuteInputObjectData(*args, **kwargs)[source]

Allows specifying specific schema conditions that fails underlying schema definition validation if present.

Corresponds to the not specifier of OpenAPI specification.

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

summary = 'Data provided as any object schema.'[source]
description = 'Data provided as any object schema. This content can represent any JSON definition. It is...'[source]
_not[source]
class weaver.wps_restapi.swagger_definitions.ExecuteInputAnyObjectValue(*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
# (each schema must provide the same property name)
class SomeAnimal(OneOfMappingSchema):
    discriminator = "type"
    _one_of = [
        Cat(),
        Dog(),
    ]

# If more specific mapping resolutions than 1-to-1 by name are needed,
# an explicit dictionary can be specified instead.
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

summary = 'Data provided as any object schema.'[source]
_one_of[source]
class weaver.wps_restapi.swagger_definitions.ExecuteInputQualifiedLiteralValue(*args, **kwargs)[source]

Used to respect mediaType field as suggested per OGC-API.

_schema[source]
value[source]
class weaver.wps_restapi.swagger_definitions.ExecuteInputQualifiedAnyObjectValue(*args, **kwargs)[source]

Used to respect mediaType field as suggested per OGC-API.

_schema[source]
value[source]
mediaType[source]
class weaver.wps_restapi.swagger_definitions.ExecuteInputQualifiedValue(*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
# (each schema must provide the same property name)
class SomeAnimal(OneOfMappingSchema):
    discriminator = "type"
    _one_of = [
        Cat(),
        Dog(),
    ]

# If more specific mapping resolutions than 1-to-1 by name are needed,
# an explicit dictionary can be specified instead.
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 = 'ExecuteInputQualifiedValue'[source]
_schema[source]
_schema_include_deserialize = False[source]
_one_of[source]
class weaver.wps_restapi.swagger_definitions.ExecuteInputInlineOrRefData(*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
# (each schema must provide the same property name)
class SomeAnimal(OneOfMappingSchema):
    discriminator = "type"
    _one_of = [
        Cat(),
        Dog(),
    ]

# If more specific mapping resolutions than 1-to-1 by name are needed,
# an explicit dictionary can be specified instead.
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[source]
_one_of[source]
class weaver.wps_restapi.swagger_definitions.ExecuteInputArrayValues(*args, **kwargs)[source]

Sequence schema that supports all applicable extended schema node functionalities.

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_value[source]
class weaver.wps_restapi.swagger_definitions.ExecuteInputData(*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
# (each schema must provide the same property name)
class SomeAnimal(OneOfMappingSchema):
    discriminator = "type"
    _one_of = [
        Cat(),
        Dog(),
    ]

# If more specific mapping resolutions than 1-to-1 by name are needed,
# an explicit dictionary can be specified instead.
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 = 'Execute data definition of the input.'[source]
_one_of[source]
class weaver.wps_restapi.swagger_definitions.ExecuteInputMapAdditionalProperties(*args, **kwargs)[source]

Object schema that will raise any unknown field not represented by children schema.

This is equivalent to OpenAPI object mapping with additionalProperties: false. This type is useful for defining a dictionary that matches exactly a specific set of values and children schema.

..note::

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 fails validation.

See also

PermissiveMappingSchema

input_id[source]
class weaver.wps_restapi.swagger_definitions.ExecuteInputMapValues(*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.ExecuteInputValues(*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
# (each schema must provide the same property name)
class SomeAnimal(OneOfMappingSchema):
    discriminator = "type"
    _one_of = [
        Cat(),
        Dog(),
    ]

# If more specific mapping resolutions than 1-to-1 by name are needed,
# an explicit dictionary can be specified instead.
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.ExecuteInputOutputs(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

inputs[source]
outputs[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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

_schema[source]
examples[source]
mode[source]
response[source]
notification_email[source]
subscribers[source]
class weaver.wps_restapi.swagger_definitions.QuoteStatusSchema(*args, **kwargs)[source]

Base schema node with support of extended functionalities.

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]
class weaver.wps_restapi.swagger_definitions.PartialQuoteSchema(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

status[source]
quoteID[source]
processID[source]
class weaver.wps_restapi.swagger_definitions.DecimalRegex(regex, msg=None, flags=0)[source]

Regular expression validator.

Initialize it with the string regular expression regex that will be compiled and matched against value when validator is called. It uses Python’s re.match(), which only matches at the beginning of the string and not at the beginning of each line. To match the entire string, enclose the regular expression with ^ and $. If msg is supplied, it will be the error message to be used; otherwise, defaults to ‘String does not match expected pattern’.

The regex expression behaviour can be modified by specifying any flags value taken by re.compile.

The regex argument may also be a pattern object (the result of re.compile) instead of a string.

When calling, if value matches the regular expression, validation succeeds; otherwise, colander.Invalid is raised with the msg error message.

class weaver.wps_restapi.swagger_definitions.PriceAmount(*args, **kwargs)[source]

Base schema node with support of extended functionalities.

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]
format = 'decimal'[source]
description = 'Monetary value of the price.'[source]
validator[source]
class weaver.wps_restapi.swagger_definitions.PriceCurrency(*args, **kwargs)[source]

Base schema node with support of extended functionalities.

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 = 'Currency code in ISO-4217 format.'[source]
default = 'USD'[source]
validator[source]
class weaver.wps_restapi.swagger_definitions.PriceSchema(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

amount[source]
currency[source]
class weaver.wps_restapi.swagger_definitions.QuoteProcessParameters(*args: Any, **kwargs: Any)[source]

Object schema that will preserve 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.

..note::

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 using preserve are passed down without any validation. Other fields that are explicitly specified with sub-schema nodes will still be validated as per usual behaviour.

See also

StrictMappingSchema

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 = 'Parameters passed for traditional process execution (inputs, outputs) with added metadata for...'[source]
class weaver.wps_restapi.swagger_definitions.QuoteEstimateValue(*args: Any, **kwargs: Any)[source]

Object schema that will preserve 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.

..note::

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 using preserve are passed down without any validation. Other fields that are explicitly specified with sub-schema nodes will still be validated as per usual behaviour.

See also

StrictMappingSchema

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 = 'Details of an estimated value, with it attributed rate and resulting cost.'[source]
estimate[source]
rate[source]
cost[source]
class weaver.wps_restapi.swagger_definitions.QuoteStepChainedInputLiteral(*args, **kwargs)[source]

Object schema that will raise any unknown field not represented by children schema.

This is equivalent to OpenAPI object mapping with additionalProperties: false. This type is useful for defining a dictionary that matches exactly a specific set of values and children schema.

..note::

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 fails validation.

See also

PermissiveMappingSchema

value[source]
class weaver.wps_restapi.swagger_definitions.QuoteStepChainedInputComplex(*args, **kwargs)[source]

Object schema that will raise any unknown field not represented by children schema.

This is equivalent to OpenAPI object mapping with additionalProperties: false. This type is useful for defining a dictionary that matches exactly a specific set of values and children schema.

..note::

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 fails validation.

See also

PermissiveMappingSchema

size[source]
class weaver.wps_restapi.swagger_definitions.QuoteStepChainedInput(*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
# (each schema must provide the same property name)
class SomeAnimal(OneOfMappingSchema):
    discriminator = "type"
    _one_of = [
        Cat(),
        Dog(),
    ]

# If more specific mapping resolutions than 1-to-1 by name are needed,
# an explicit dictionary can be specified instead.
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.QuoteStepOutputParameters(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

description = 'Outputs from a quote estimation to be chained as inputs for a following Workflow step.'[source]
output_id[source]
class weaver.wps_restapi.swagger_definitions.QuoteProcessResults(*args: Any, **kwargs: Any)[source]

Object schema that will preserve 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.

..note::

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 using preserve are passed down without any validation. Other fields that are explicitly specified with sub-schema nodes will still be validated as per usual behaviour.

See also

StrictMappingSchema

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[source]
description = 'Results of the quote estimation. Will be empty until completed. Contents may vary according to...'[source]
flat[source]
memory[source]
storage[source]
duration[source]
cpu[source]
gpu[source]
total[source]
currency[source]
class weaver.wps_restapi.swagger_definitions.UserIdSchema(*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
# (each schema must provide the same property name)
class SomeAnimal(OneOfMappingSchema):
    discriminator = "type"
    _one_of = [
        Cat(),
        Dog(),
    ]

# If more specific mapping resolutions than 1-to-1 by name are needed,
# an explicit dictionary can be specified instead.
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.StepQuotation(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

detail[source]
price[source]
expire[source]
created[source]
userID[source]
estimatedTime[source]
estimatedSeconds[source]
estimatedDuration[source]
processParameters[source]
results[source]
outputs[source]
class weaver.wps_restapi.swagger_definitions.StepQuotationList(*args, **kwargs)[source]

Sequence schema that supports all applicable extended schema node functionalities.

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 = 'Detailed child processes and prices part of the complete quote.'[source]
step[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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

paid[source]
steps[source]
class weaver.wps_restapi.swagger_definitions.QuoteStepReferenceList(*args, **kwargs)[source]

Sequence schema that supports all applicable extended schema node functionalities.

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 = 'Summary of child process quote references part of the complete quote.'[source]
ref[source]
class weaver.wps_restapi.swagger_definitions.QuoteBase(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

price[source]
class weaver.wps_restapi.swagger_definitions.QuoteSummary(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

steps[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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

class weaver.wps_restapi.swagger_definitions.QuotationList(*args, **kwargs)[source]

Sequence schema that supports all applicable extended schema node functionalities.

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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

_sort_first[source]
_sort_after[source]
quotations[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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

billID[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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

billID[source]
quoteID[source]
processID[source]
jobID[source]
title[source]
description[source]
price[source]
created[source]
userID[source]
class weaver.wps_restapi.swagger_definitions.BillList(*args, **kwargs)[source]

Sequence schema that supports all applicable extended schema node functionalities.

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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • 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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • 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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

class weaver.wps_restapi.swagger_definitions.CWLClass(*args, **kwargs)[source]

Base schema node with support of extended functionalities.

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.CWLExpression(*args, **kwargs)[source]

Base schema node with support of extended functionalities.

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 = 'CWLExpression'[source]
description[source]
class weaver.wps_restapi.swagger_definitions.RequirementClass(*args, **kwargs)[source]

Base schema node with support of extended functionalities.

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.CUDAComputeCapability(*args, **kwargs)[source]

Base schema node with support of extended functionalities.

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 = '3.0'[source]
title = 'CUDA compute capability'[source]
description = 'The compute capability supported by the GPU hardware.'[source]
validator[source]
class weaver.wps_restapi.swagger_definitions.CUDAComputeCapabilityArray(*args, **kwargs)[source]

Sequence schema that supports all applicable extended schema node functionalities.

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]
validator[source]
class weaver.wps_restapi.swagger_definitions.CUDAComputeCapabilitySchema(*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
# (each schema must provide the same property name)
class SomeAnimal(OneOfMappingSchema):
    discriminator = "type"
    _one_of = [
        Cat(),
        Dog(),
    ]

# If more specific mapping resolutions than 1-to-1 by name are needed,
# an explicit dictionary can be specified instead.
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[source]
description[source]
_one_of[source]
class weaver.wps_restapi.swagger_definitions.CUDARequirementSpecification(*args: Any, **kwargs: Any)[source]

Object schema that will preserve 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.

..note::

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 using preserve are passed down without any validation. Other fields that are explicitly specified with sub-schema nodes will still be validated as per usual behaviour.

See also

StrictMappingSchema

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.

cudaVersionMin[source]
cudaComputeCapability[source]
cudaDeviceCountMin[source]
cudaDeviceCountMax[source]
class weaver.wps_restapi.swagger_definitions.CUDARequirementMap(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

CUDARequirement[source]
class weaver.wps_restapi.swagger_definitions.CUDARequirementClass(*args: Any, **kwargs: Any)[source]

Object schema that will preserve 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.

..note::

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 using preserve are passed down without any validation. Other fields that are explicitly specified with sub-schema nodes will still be validated as per usual behaviour.

See also

StrictMappingSchema

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.NetworkAccessRequirementSpecification(*args: Any, **kwargs: Any)[source]

Object schema that will preserve 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.

..note::

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 using preserve are passed down without any validation. Other fields that are explicitly specified with sub-schema nodes will still be validated as per usual behaviour.

See also

StrictMappingSchema

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.

networkAccess[source]
class weaver.wps_restapi.swagger_definitions.NetworkAccessRequirementMap(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

NetworkAccessRequirement[source]
class weaver.wps_restapi.swagger_definitions.NetworkAccessRequirementClass(*args: Any, **kwargs: Any)[source]

Object schema that will preserve 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.

..note::

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 using preserve are passed down without any validation. Other fields that are explicitly specified with sub-schema nodes will still be validated as per usual behaviour.

See also

StrictMappingSchema

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.ResourceRequirementValue(*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
# (each schema must provide the same property name)
class SomeAnimal(OneOfMappingSchema):
    discriminator = "type"
    _one_of = [
        Cat(),
        Dog(),
    ]

# If more specific mapping resolutions than 1-to-1 by name are needed,
# an explicit dictionary can be specified instead.
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.ResourceRequirementSpecification(*args: Any, **kwargs: Any)[source]

Object schema that will preserve 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.

..note::

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 using preserve are passed down without any validation. Other fields that are explicitly specified with sub-schema nodes will still be validated as per usual behaviour.

See also

StrictMappingSchema

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[source]
coresMin[source]
coresMax[source]
ramMin[source]
ramMax[source]
tmpdirMin[source]
tmpdirMax[source]
outdirMin[source]
outdirMax[source]
class weaver.wps_restapi.swagger_definitions.ResourceRequirementMap(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

ResourceRequirement[source]
class weaver.wps_restapi.swagger_definitions.ResourceRequirementClass(*args: Any, **kwargs: Any)[source]

Object schema that will preserve 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.

..note::

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 using preserve are passed down without any validation. Other fields that are explicitly specified with sub-schema nodes will still be validated as per usual behaviour.

See also

StrictMappingSchema

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.DockerRequirementSpecification(*args: Any, **kwargs: Any)[source]

Object schema that will preserve 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.

..note::

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 using preserve are passed down without any validation. Other fields that are explicitly specified with sub-schema nodes will still be validated as per usual behaviour.

See also

StrictMappingSchema

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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

DockerRequirement[source]
class weaver.wps_restapi.swagger_definitions.DockerRequirementClass(*args: Any, **kwargs: Any)[source]

Object schema that will preserve 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.

..note::

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 using preserve are passed down without any validation. Other fields that are explicitly specified with sub-schema nodes will still be validated as per usual behaviour.

See also

StrictMappingSchema

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: Any, **kwargs: Any)[source]

Object schema that will preserve 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.

..note::

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 using preserve are passed down without any validation. Other fields that are explicitly specified with sub-schema nodes will still be validated as per usual behaviour.

See also

StrictMappingSchema

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.

deprecated = True[source]
description[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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

deprecated = True[source]
req[source]
class weaver.wps_restapi.swagger_definitions.DockerGpuRequirementClass(*args: Any, **kwargs: Any)[source]

Object schema that will preserve 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.

..note::

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 using preserve are passed down without any validation. Other fields that are explicitly specified with sub-schema nodes will still be validated as per usual behaviour.

See also

StrictMappingSchema

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.

deprecated = True[source]
title[source]
_class[source]
class weaver.wps_restapi.swagger_definitions.DirectoryListingItem(*args: Any, **kwargs: Any)[source]

Object schema that will preserve 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.

..note::

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 using preserve are passed down without any validation. Other fields that are explicitly specified with sub-schema nodes will still be validated as per usual behaviour.

See also

StrictMappingSchema

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]
entryname[source]
writable[source]
class weaver.wps_restapi.swagger_definitions.InitialWorkDirListing(*args, **kwargs)[source]

Sequence schema that supports all applicable extended schema node functionalities.

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.InitialWorkDirRequirementSpecification(*args: Any, **kwargs: Any)[source]

Object schema that will preserve 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.

..note::

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 using preserve are passed down without any validation. Other fields that are explicitly specified with sub-schema nodes will still be validated as per usual behaviour.

See also

StrictMappingSchema

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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

req[source]
class weaver.wps_restapi.swagger_definitions.InitialWorkDirRequirementClass(*args: Any, **kwargs: Any)[source]

Object schema that will preserve 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.

..note::

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 using preserve are passed down without any validation. Other fields that are explicitly specified with sub-schema nodes will still be validated as per usual behaviour.

See also

StrictMappingSchema

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.InlineJavascriptLibraries(*args, **kwargs)[source]

Sequence schema that supports all applicable extended schema node functionalities.

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[source]
exp_lib[source]
class weaver.wps_restapi.swagger_definitions.InlineJavascriptRequirementSpecification(*args: Any, **kwargs: Any)[source]

Object schema that will preserve 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.

..note::

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 using preserve are passed down without any validation. Other fields that are explicitly specified with sub-schema nodes will still be validated as per usual behaviour.

See also

StrictMappingSchema

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[source]
expressionLib[source]
class weaver.wps_restapi.swagger_definitions.InlineJavascriptRequirementMap(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

req[source]
class weaver.wps_restapi.swagger_definitions.InlineJavascriptRequirementClass(*args: Any, **kwargs: Any)[source]

Object schema that will preserve 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.

..note::

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 using preserve are passed down without any validation. Other fields that are explicitly specified with sub-schema nodes will still be validated as per usual behaviour.

See also

StrictMappingSchema

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.InplaceUpdateRequirementSpecification(*args: Any, **kwargs: Any)[source]

Object schema that will preserve 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.

..note::

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 using preserve are passed down without any validation. Other fields that are explicitly specified with sub-schema nodes will still be validated as per usual behaviour.

See also

StrictMappingSchema

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[source]
inplaceUpdate[source]
class weaver.wps_restapi.swagger_definitions.InplaceUpdateRequirementMap(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

req[source]
class weaver.wps_restapi.swagger_definitions.InplaceUpdateRequirementClass(*args: Any, **kwargs: Any)[source]

Object schema that will preserve 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.

..note::

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 using preserve are passed down without any validation. Other fields that are explicitly specified with sub-schema nodes will still be validated as per usual behaviour.

See also

StrictMappingSchema

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.LoadListingEnum(*args, **kwargs)[source]

Base schema node with support of extended functionalities.

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 = 'LoadListingEnum'[source]
validator[source]
class weaver.wps_restapi.swagger_definitions.LoadListingRequirementSpecification(*args: Any, **kwargs: Any)[source]

Object schema that will preserve 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.

..note::

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 using preserve are passed down without any validation. Other fields that are explicitly specified with sub-schema nodes will still be validated as per usual behaviour.

See also

StrictMappingSchema

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[source]
loadListing[source]
class weaver.wps_restapi.swagger_definitions.LoadListingRequirementMap(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

req[source]
class weaver.wps_restapi.swagger_definitions.LoadListingRequirementClass(*args: Any, **kwargs: Any)[source]

Object schema that will preserve 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.

..note::

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 using preserve are passed down without any validation. Other fields that are explicitly specified with sub-schema nodes will still be validated as per usual behaviour.

See also

StrictMappingSchema

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.IdentifierArray(*args, **kwargs)[source]

Sequence schema that supports all applicable extended schema node functionalities.

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.ScatterIdentifiersSchema(*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
# (each schema must provide the same property name)
class SomeAnimal(OneOfMappingSchema):
    discriminator = "type"
    _one_of = [
        Cat(),
        Dog(),
    ]

# If more specific mapping resolutions than 1-to-1 by name are needed,
# an explicit dictionary can be specified instead.
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 = 'Scatter'[source]
description[source]
_one_of[source]
class weaver.wps_restapi.swagger_definitions.ScatterFeatureRequirementSpecification(*args: Any, **kwargs: Any)[source]

Object schema that will preserve 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.

..note::

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 using preserve are passed down without any validation. Other fields that are explicitly specified with sub-schema nodes will still be validated as per usual behaviour.

See also

StrictMappingSchema

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[source]
scatter[source]
scatterMethod[source]
class weaver.wps_restapi.swagger_definitions.ScatterFeatureRequirementMap(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

req[source]
class weaver.wps_restapi.swagger_definitions.ScatterFeatureRequirementClass(*args: Any, **kwargs: Any)[source]

Object schema that will preserve 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.

..note::

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 using preserve are passed down without any validation. Other fields that are explicitly specified with sub-schema nodes will still be validated as per usual behaviour.

See also

StrictMappingSchema

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.TimeLimitValue(*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
# (each schema must provide the same property name)
class SomeAnimal(OneOfMappingSchema):
    discriminator = "type"
    _one_of = [
        Cat(),
        Dog(),
    ]

# If more specific mapping resolutions than 1-to-1 by name are needed,
# an explicit dictionary can be specified instead.
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.ToolTimeLimitRequirementSpecification(*args: Any, **kwargs: Any)[source]

Object schema that will preserve 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.

..note::

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 using preserve are passed down without any validation. Other fields that are explicitly specified with sub-schema nodes will still be validated as per usual behaviour.

See also

StrictMappingSchema

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[source]
timelimit[source]
class weaver.wps_restapi.swagger_definitions.ToolTimeLimitRequirementMap(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

req[source]
class weaver.wps_restapi.swagger_definitions.ToolTimeLimitRequirementClass(*args: Any, **kwargs: Any)[source]

Object schema that will preserve 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.

..note::

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 using preserve are passed down without any validation. Other fields that are explicitly specified with sub-schema nodes will still be validated as per usual behaviour.

See also

StrictMappingSchema

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.EnableReuseValue(*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
# (each schema must provide the same property name)
class SomeAnimal(OneOfMappingSchema):
    discriminator = "type"
    _one_of = [
        Cat(),
        Dog(),
    ]

# If more specific mapping resolutions than 1-to-1 by name are needed,
# an explicit dictionary can be specified instead.
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.WorkReuseRequirementSpecification(*args: Any, **kwargs: Any)[source]

Object schema that will preserve 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.

..note::

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 using preserve are passed down without any validation. Other fields that are explicitly specified with sub-schema nodes will still be validated as per usual behaviour.

See also

StrictMappingSchema

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[source]
enableReuse[source]
class weaver.wps_restapi.swagger_definitions.WorkReuseRequirementMap(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

req[source]
class weaver.wps_restapi.swagger_definitions.WorkReuseRequirementClass(*args: Any, **kwargs: Any)[source]

Object schema that will preserve 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.

..note::

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 using preserve are passed down without any validation. Other fields that are explicitly specified with sub-schema nodes will still be validated as per usual behaviour.

See also

StrictMappingSchema

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: Any, **kwargs: Any)[source]

Object schema that will preserve 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.

..note::

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 using preserve are passed down without any validation. Other fields that are explicitly specified with sub-schema nodes will still be validated as per usual behaviour.

See also

StrictMappingSchema

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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

req[source]
class weaver.wps_restapi.swagger_definitions.BuiltinRequirementClass(*args: Any, **kwargs: Any)[source]

Object schema that will preserve 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.

..note::

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 using preserve are passed down without any validation. Other fields that are explicitly specified with sub-schema nodes will still be validated as per usual behaviour.

See also

StrictMappingSchema

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: Any, **kwargs: Any)[source]

Object schema that will preserve 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.

..note::

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 using preserve are passed down without any validation. Other fields that are explicitly specified with sub-schema nodes will still be validated as per usual behaviour.

See also

StrictMappingSchema

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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

req[source]
class weaver.wps_restapi.swagger_definitions.ESGF_CWT_RequirementClass(*args: Any, **kwargs: Any)[source]

Object schema that will preserve 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.

..note::

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 using preserve are passed down without any validation. Other fields that are explicitly specified with sub-schema nodes will still be validated as per usual behaviour.

See also

StrictMappingSchema

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.OGCAPIRequirementSpecification(*args: Any, **kwargs: Any)[source]

Object schema that will preserve 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.

..note::

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 using preserve are passed down without any validation. Other fields that are explicitly specified with sub-schema nodes will still be validated as per usual behaviour.

See also

StrictMappingSchema

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 OGC API - Processes providerthat...'[source]
process[source]
class weaver.wps_restapi.swagger_definitions.OGCAPIRequirementMap(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

req[source]
class weaver.wps_restapi.swagger_definitions.OGCAPIRequirementClass(*args: Any, **kwargs: Any)[source]

Object schema that will preserve 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.

..note::

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 using preserve are passed down without any validation. Other fields that are explicitly specified with sub-schema nodes will still be validated as per usual behaviour.

See also

StrictMappingSchema

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: Any, **kwargs: Any)[source]

Object schema that will preserve 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.

..note::

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 using preserve are passed down without any validation. Other fields that are explicitly specified with sub-schema nodes will still be validated as per usual behaviour.

See also

StrictMappingSchema

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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

req[source]
class weaver.wps_restapi.swagger_definitions.WPS1RequirementClass(*args: Any, **kwargs: Any)[source]

Object schema that will preserve 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.

..note::

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 using preserve are passed down without any validation. Other fields that are explicitly specified with sub-schema nodes will still be validated as per usual behaviour.

See also

StrictMappingSchema

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.UnknownRequirementMap(*args: Any, **kwargs: Any)[source]

Object schema that will preserve 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.

..note::

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 using preserve are passed down without any validation. Other fields that are explicitly specified with sub-schema nodes will still be validated as per usual behaviour.

See also

StrictMappingSchema

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 = 'Generic schema to allow alternative CWL requirements/hints not explicitly defined in schemas.'[source]
class weaver.wps_restapi.swagger_definitions.UnknownRequirementClass(*args: Any, **kwargs: Any)[source]

Object schema that will preserve 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.

..note::

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 using preserve are passed down without any validation. Other fields that are explicitly specified with sub-schema nodes will still be validated as per usual behaviour.

See also

StrictMappingSchema

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
# (each schema must provide the same property name)
class SomeAnimal(OneOfMappingSchema):
    discriminator = "type"
    _one_of = [
        Cat(),
        Dog(),
    ]

# If more specific mapping resolutions than 1-to-1 by name are needed,
# an explicit dictionary can be specified instead.
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.CWLRequirementsList(*args, **kwargs)[source]

Sequence schema that supports all applicable extended schema node functionalities.

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
# (each schema must provide the same property name)
class SomeAnimal(OneOfMappingSchema):
    discriminator = "type"
    _one_of = [
        Cat(),
        Dog(),
    ]

# If more specific mapping resolutions than 1-to-1 by name are needed,
# an explicit dictionary can be specified instead.
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
# (each schema must provide the same property name)
class SomeAnimal(OneOfMappingSchema):
    discriminator = "type"
    _one_of = [
        Cat(),
        Dog(),
    ]

# If more specific mapping resolutions than 1-to-1 by name are needed,
# an explicit dictionary can be specified instead.
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]

Sequence schema that supports all applicable extended schema node functionalities.

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
# (each schema must provide the same property name)
class SomeAnimal(OneOfMappingSchema):
    discriminator = "type"
    _one_of = [
        Cat(),
        Dog(),
    ]

# If more specific mapping resolutions than 1-to-1 by name are needed,
# an explicit dictionary can be specified instead.
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]

Sequence schema that supports all applicable extended schema node functionalities.

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]

Base schema node with support of extended functionalities.

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 = 'Field type definition.'[source]
example = 'float'[source]
validator[source]
class weaver.wps_restapi.swagger_definitions.CWLTypeSymbolValues(*args, **kwargs)[source]

Base schema node with support of extended functionalities.

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.CWLTypeSymbols(*args, **kwargs)[source]

Sequence schema that supports all applicable extended schema node functionalities.

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.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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

type[source]
symbols[source]
class weaver.wps_restapi.swagger_definitions.CWLTypeArrayItemObject(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

type[source]
class weaver.wps_restapi.swagger_definitions.CWLTypeArrayItems(*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
# (each schema must provide the same property name)
class SomeAnimal(OneOfMappingSchema):
    discriminator = "type"
    _one_of = [
        Cat(),
        Dog(),
    ]

# If more specific mapping resolutions than 1-to-1 by name are needed,
# an explicit dictionary can be specified instead.
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.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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

type[source]
items[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
# (each schema must provide the same property name)
class SomeAnimal(OneOfMappingSchema):
    discriminator = "type"
    _one_of = [
        Cat(),
        Dog(),
    ]

# If more specific mapping resolutions than 1-to-1 by name are needed,
# an explicit dictionary can be specified instead.
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]

Sequence schema that supports all applicable extended schema node functionalities.

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
# (each schema must provide the same property name)
class SomeAnimal(OneOfMappingSchema):
    discriminator = "type"
    _one_of = [
        Cat(),
        Dog(),
    ]

# If more specific mapping resolutions than 1-to-1 by name are needed,
# an explicit dictionary can be specified instead.
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.AnyLiteralList(*args, **kwargs)[source]

Sequence schema that supports all applicable extended schema node functionalities.

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
# (each schema must provide the same property name)
class SomeAnimal(OneOfMappingSchema):
    discriminator = "type"
    _one_of = [
        Cat(),
        Dog(),
    ]

# If more specific mapping resolutions than 1-to-1 by name are needed,
# an explicit dictionary can be specified instead.
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: Any, **kwargs: Any)[source]

Object schema that will preserve 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.

..note::

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 using preserve are passed down without any validation. Other fields that are explicitly specified with sub-schema nodes will still be validated as per usual behaviour.

See also

StrictMappingSchema

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]

Sequence schema that supports all applicable extended schema node functionalities.

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
# (each schema must provide the same property name)
class SomeAnimal(OneOfMappingSchema):
    discriminator = "type"
    _one_of = [
        Cat(),
        Dog(),
    ]

# If more specific mapping resolutions than 1-to-1 by name are needed,
# an explicit dictionary can be specified instead.
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: Any, **kwargs: Any)[source]

Object schema that will preserve 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.

..note::

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 using preserve are passed down without any validation. Other fields that are explicitly specified with sub-schema nodes will still be validated as per usual behaviour.

See also

StrictMappingSchema

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: Any, **kwargs: Any)[source]

Object schema that will preserve 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.

..note::

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 using preserve are passed down without any validation. Other fields that are explicitly specified with sub-schema nodes will still be validated as per usual behaviour.

See also

StrictMappingSchema

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]

Sequence schema that supports all applicable extended schema node functionalities.

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.CWLInputEmpty(*args: Any, **kwargs: Any)[source]

Mapping that guarantees it is completely empty for validation during deserialization.

Any children added to this schema are removed automatically.

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
# (each schema must provide the same property name)
class SomeAnimal(OneOfMappingSchema):
    discriminator = "type"
    _one_of = [
        Cat(),
        Dog(),
    ]

# If more specific mapping resolutions than 1-to-1 by name are needed,
# an explicit dictionary can be specified instead.
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: Any, **kwargs: Any)[source]

Object schema that will preserve 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.

..note::

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 using preserve are passed down without any validation. Other fields that are explicitly specified with sub-schema nodes will still be validated as per usual behaviour.

See also

StrictMappingSchema

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: Any, **kwargs: Any)[source]

Object schema that will preserve 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.

..note::

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 using preserve are passed down without any validation. Other fields that are explicitly specified with sub-schema nodes will still be validated as per usual behaviour.

See also

StrictMappingSchema

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
# (each schema must provide the same property name)
class SomeAnimal(OneOfMappingSchema):
    discriminator = "type"
    _one_of = [
        Cat(),
        Dog(),
    ]

# If more specific mapping resolutions than 1-to-1 by name are needed,
# an explicit dictionary can be specified instead.
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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

output_id[source]
class weaver.wps_restapi.swagger_definitions.CWLOutputItem(*args: Any, **kwargs: Any)[source]

Object schema that will preserve 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.

..note::

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 using preserve are passed down without any validation. Other fields that are explicitly specified with sub-schema nodes will still be validated as per usual behaviour.

See also

StrictMappingSchema

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]

Sequence schema that supports all applicable extended schema node functionalities.

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
# (each schema must provide the same property name)
class SomeAnimal(OneOfMappingSchema):
    discriminator = "type"
    _one_of = [
        Cat(),
        Dog(),
    ]

# If more specific mapping resolutions than 1-to-1 by name are needed,
# an explicit dictionary can be specified instead.
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]

Sequence schema that supports all applicable extended schema node functionalities.

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
# (each schema must provide the same property name)
class SomeAnimal(OneOfMappingSchema):
    discriminator = "type"
    _one_of = [
        Cat(),
        Dog(),
    ]

# If more specific mapping resolutions than 1-to-1 by name are needed,
# an explicit dictionary can be specified instead.
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]

Base schema node with support of extended functionalities.

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.CWLIdentifier(*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 = 'Reference to the process identifier. If CWL is provided within a process deployment payload,...'[source]
class weaver.wps_restapi.swagger_definitions.CWLIntentURL(*args, **kwargs)[source]

Base schema node with support of extended functionalities.

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 = 'Identifier URL to a concept for the type of computational operation accomplished by this Process...'[source]
class weaver.wps_restapi.swagger_definitions.CWLIntent(*args, **kwargs)[source]

Sequence schema that supports all applicable extended schema node functionalities.

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.CWLBase(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

cwlVersion[source]
class weaver.wps_restapi.swagger_definitions.CWLScatterMulti(*args, **kwargs)[source]

Sequence schema that supports all applicable extended schema node functionalities.

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

id[source]
class weaver.wps_restapi.swagger_definitions.CWLScatter(*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
# (each schema must provide the same property name)
class SomeAnimal(OneOfMappingSchema):
    discriminator = "type"
    _one_of = [
        Cat(),
        Dog(),
    ]

# If more specific mapping resolutions than 1-to-1 by name are needed,
# an explicit dictionary can be specified instead.
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.CWLScatterMethod(*args, **kwargs)[source]

Base schema node with support of extended functionalities.

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 = "Describes how to decompose the scattered input into a discrete set of jobs. When 'dotproduct',..."[source]
validator[source]
class weaver.wps_restapi.swagger_definitions.CWLApp(*args: Any, **kwargs: Any)[source]

Object schema that will preserve 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.

..note::

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 using preserve are passed down without any validation. Other fields that are explicitly specified with sub-schema nodes will still be validated as per usual behaviour.

See also

StrictMappingSchema

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]
id[source]
intent[source]
requirements[source]
hints[source]
baseCommand[source]
arguments[source]
inputs[source]
outputs[source]
scatter[source]
scatterMethod[source]
class weaver.wps_restapi.swagger_definitions.CWL(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

_schema[source]
_sort_first = ['$schema', 'cwlVersion', 'id', 'class'][source]
class weaver.wps_restapi.swagger_definitions.ExecutionUnitCWL(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

description[source]
class weaver.wps_restapi.swagger_definitions.ExecutionUnitNested(*args, **kwargs)[source]

Object schema that will raise any unknown field not represented by children schema.

This is equivalent to OpenAPI object mapping with additionalProperties: false. This type is useful for defining a dictionary that matches exactly a specific set of values and children schema.

..note::

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 fails validation.

See also

PermissiveMappingSchema

unit[source]
type[source]
class weaver.wps_restapi.swagger_definitions.ProviderSummaryList(*args, **kwargs)[source]

Sequence schema that supports all applicable extended schema node functionalities.

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_service[source]
class weaver.wps_restapi.swagger_definitions.ProviderNamesList(*args, **kwargs)[source]

Sequence schema that supports all applicable extended schema node functionalities.

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_name[source]
class weaver.wps_restapi.swagger_definitions.ProviderListing(*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
# (each schema must provide the same property name)
class SomeAnimal(OneOfMappingSchema):
    discriminator = "type"
    _one_of = [
        Cat(),
        Dog(),
    ]

# If more specific mapping resolutions than 1-to-1 by name are needed,
# an explicit dictionary can be specified instead.
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.ProvidersBodySchema(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

checked[source]
providers[source]
class weaver.wps_restapi.swagger_definitions.ProviderProcessesSchema(*args, **kwargs)[source]

Sequence schema that supports all applicable extended schema node functionalities.

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_process[source]
class weaver.wps_restapi.swagger_definitions.JobOutputReference(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

href[source]
type[source]
format[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
# (each schema must provide the same property name)
class SomeAnimal(OneOfMappingSchema):
    discriminator = "type"
    _one_of = [
        Cat(),
        Dog(),
    ]

# If more specific mapping resolutions than 1-to-1 by name are needed,
# an explicit dictionary can be specified instead.
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.JobOutputMap(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

output_id[source]
class weaver.wps_restapi.swagger_definitions.JobOutputList(*args, **kwargs)[source]

Sequence schema that supports all applicable extended schema node functionalities.

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.JobOutputs(*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
# (each schema must provide the same property name)
class SomeAnimal(OneOfMappingSchema):
    discriminator = "type"
    _one_of = [
        Cat(),
        Dog(),
    ]

# If more specific mapping resolutions than 1-to-1 by name are needed,
# an explicit dictionary can be specified instead.
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.ResultLiteral(*args, **kwargs)[source]

Submitted values that correspond to literal data.

class weaver.wps_restapi.swagger_definitions.ResultLiteralList(*args, **kwargs)[source]

Sequence schema that supports all applicable extended schema node functionalities.

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]

Format employed for reference results respecting ‘OGC API - Processes’ schemas.

_schema[source]
_schema_include_deserialize = False[source]
value[source]
format[source]
class weaver.wps_restapi.swagger_definitions.ValueFormattedList(*args, **kwargs)[source]

Sequence schema that supports all applicable extended schema node functionalities.

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.ResultBoundingBox(*args, **kwargs)[source]

Object schema that will raise any unknown field not represented by children schema.

This is equivalent to OpenAPI object mapping with additionalProperties: false. This type is useful for defining a dictionary that matches exactly a specific set of values and children schema.

..note::

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 fails validation.

See also

PermissiveMappingSchema

_schema_include_deserialize = False[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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

_schema[source]
_schema_include_deserialize = False[source]
href[source]
type[source]
format[source]
class weaver.wps_restapi.swagger_definitions.ResultReferenceList(*args, **kwargs)[source]

Sequence schema that supports all applicable extended schema node functionalities.

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
# (each schema must provide the same property name)
class SomeAnimal(OneOfMappingSchema):
    discriminator = "type"
    _one_of = [
        Cat(),
        Dog(),
    ]

# If more specific mapping resolutions than 1-to-1 by name are needed,
# an explicit dictionary can be specified instead.
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[source]
_one_of[source]
class weaver.wps_restapi.swagger_definitions.Result(*args, **kwargs)[source]

Result outputs obtained from a successful process job execution.

_schema[source]
output_id[source]
class weaver.wps_restapi.swagger_definitions.JobInputsBody(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

class weaver.wps_restapi.swagger_definitions.JobOutputsBody(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

outputs[source]
class weaver.wps_restapi.swagger_definitions.JobExceptionPlain(*args, **kwargs)[source]

Base schema node with support of extended functionalities.

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 = 'Generic exception description corresponding to any error message.'[source]
class weaver.wps_restapi.swagger_definitions.JobExceptionDetailed(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

description = "Fields correspond exactly to 'owslib.wps.WPSException' represented as dictionary."[source]
Code[source]
Locator[source]
Text[source]
class weaver.wps_restapi.swagger_definitions.JobException(*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
# (each schema must provide the same property name)
class SomeAnimal(OneOfMappingSchema):
    discriminator = "type"
    _one_of = [
        Cat(),
        Dog(),
    ]

# If more specific mapping resolutions than 1-to-1 by name are needed,
# an explicit dictionary can be specified instead.
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.JobExceptionsSchema(*args, **kwargs)[source]

Sequence schema that supports all applicable extended schema node functionalities.

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]

Sequence schema that supports all applicable extended schema node functionalities.

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.ApplicationStatisticsSchema(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

mem[source]
mem_bytes[source]
class weaver.wps_restapi.swagger_definitions.ProcessStatisticsSchema(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

rss[source]
rss_bytes[source]
uss[source]
uss_bytes[source]
vms[source]
vms_bytes[source]
used_threads[source]
used_cpu[source]
used_handles[source]
mem[source]
mem_bytes[source]
total_size[source]
total_size_bytes[source]
class weaver.wps_restapi.swagger_definitions.OutputStatisticsSchema(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

size[source]
size_bytes[source]
class weaver.wps_restapi.swagger_definitions.OutputStatisticsMap(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

output[source]
class weaver.wps_restapi.swagger_definitions.JobStatisticsSchema(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

application[source]
process[source]
outputs[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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

name[source]
enabled[source]
url[source]
doc[source]
class weaver.wps_restapi.swagger_definitions.FrontpageParameters(*args, **kwargs)[source]

Sequence schema that supports all applicable extended schema node functionalities.

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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

_schema[source]
_sort_first = ['title', 'configuration', 'message', 'description', 'attribution'][source]
_sort_after = ['parameters', 'links'][source]
title[source]
message[source]
configuration[source]
attribution[source]
parameters[source]
class weaver.wps_restapi.swagger_definitions.OpenAPISpecSchema(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

_schema = 'https://spec.openapis.org/oas/3.0/schema/2021-09-28'[source]
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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • 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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

name[source]
type[source]
version[source]
class weaver.wps_restapi.swagger_definitions.VersionsList(*args, **kwargs)[source]

Sequence schema that supports all applicable extended schema node functionalities.

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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

versions[source]
class weaver.wps_restapi.swagger_definitions.ConformanceList(*args, **kwargs)[source]

Sequence schema that supports all applicable extended schema node functionalities.

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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

_schema[source]
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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • 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
# (each schema must provide the same property name)
class SomeAnimal(OneOfMappingSchema):
    discriminator = "type"
    _one_of = [
        Cat(),
        Dog(),
    ]

# If more specific mapping resolutions than 1-to-1 by name are needed,
# an explicit dictionary can be specified instead.
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 = 'ExecutionUnit'[source]
description = 'Definition of the Application Package to execute.'[source]
_one_of[source]
class weaver.wps_restapi.swagger_definitions.ExecutionUnitList(*args, **kwargs)[source]

Sequence schema that supports all applicable extended schema node functionalities.

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]
validator[source]
class weaver.wps_restapi.swagger_definitions.ProcessDeploymentWithContext(*args, **kwargs)[source]

Summary process definition.

description = 'Process deployment with OWS Context reference.'[source]
owsContext[source]
class weaver.wps_restapi.swagger_definitions.ProcessVersionField(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

processVersion[source]
class weaver.wps_restapi.swagger_definitions.DeployProcessOfferingContext(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

process[source]
class weaver.wps_restapi.swagger_definitions.DeployProcessDescriptionContext(*args, **kwargs)[source]

Allows specifying specific schema conditions that fails underlying schema definition validation if present.

Corresponds to the not specifier of OpenAPI specification.

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]
class weaver.wps_restapi.swagger_definitions.DeployProcessContextChoiceType(*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
# (each schema must provide the same property name)
class SomeAnimal(OneOfMappingSchema):
    discriminator = "type"
    _one_of = [
        Cat(),
        Dog(),
    ]

# If more specific mapping resolutions than 1-to-1 by name are needed,
# an explicit dictionary can be specified instead.
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.DeployProcessOffering(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

process[source]
class weaver.wps_restapi.swagger_definitions.DeployProcessDescription(*args, **kwargs)[source]

Allows specifying specific schema conditions that fails underlying schema definition validation if present.

Corresponds to the not specifier of OpenAPI specification.

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]
_schema[source]
description = 'Process description fields directly provided.'[source]
class weaver.wps_restapi.swagger_definitions.DeployReference(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

id[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
# (each schema must provide the same property name)
class SomeAnimal(OneOfMappingSchema):
    discriminator = "type"
    _one_of = [
        Cat(),
        Dog(),
    ]

# If more specific mapping resolutions than 1-to-1 by name are needed,
# an explicit dictionary can be specified instead.
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.ExecutionUnitVariations(*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
# (each schema must provide the same property name)
class SomeAnimal(OneOfMappingSchema):
    discriminator = "type"
    _one_of = [
        Cat(),
        Dog(),
    ]

# If more specific mapping resolutions than 1-to-1 by name are needed,
# an explicit dictionary can be specified instead.
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.ExecutionUnitDefinition(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

executionUnit[source]
class weaver.wps_restapi.swagger_definitions.DeployParameters(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

immediateDeployment[source]
deploymentProfileName[source]
class weaver.wps_restapi.swagger_definitions.DeployOGCAppPackage(*args, **kwargs)[source]

Allows specifying specific schema conditions that fails underlying schema definition validation if present.

Corresponds to the not specifier of OpenAPI specification.

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

description = 'Deployment using standard OGC Application Package definition.'[source]
_schema[source]
_not[source]
processDescription[source]
class weaver.wps_restapi.swagger_definitions.DeployContextDefinition(*args, **kwargs)[source]

Allows specifying specific schema conditions that fails underlying schema definition validation if present.

Corresponds to the not specifier of OpenAPI specification.

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]
processDescription[source]
class weaver.wps_restapi.swagger_definitions.CWLGraphItem(*args: Any, **kwargs: Any)[source]

Object schema that will preserve 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.

..note::

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 using preserve are passed down without any validation. Other fields that are explicitly specified with sub-schema nodes will still be validated as per usual behaviour.

See also

StrictMappingSchema

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.CWLGraphList(*args, **kwargs)[source]

Sequence schema that supports all applicable extended schema node functionalities.

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

cwl[source]
class weaver.wps_restapi.swagger_definitions.CWLGraphBase(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

graph[source]
class weaver.wps_restapi.swagger_definitions.UpdateVersion(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

version[source]
class weaver.wps_restapi.swagger_definitions.DeployCWLGraph(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

_sort_first = ['cwlVersion', 'version', '$graph'][source]
class weaver.wps_restapi.swagger_definitions.DeployCWL(*args, **kwargs)[source]

Allows specifying specific schema conditions that fails underlying schema definition validation if present.

Corresponds to the not specifier of OpenAPI specification.

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

_sort_first = ['cwlVersion', 'version', 'id', 'class'][source]
_not[source]
id[source]
class weaver.wps_restapi.swagger_definitions.DeployOGCRemoteProcess(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

id[source]
process[source]
class weaver.wps_restapi.swagger_definitions.Deploy(*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
# (each schema must provide the same property name)
class SomeAnimal(OneOfMappingSchema):
    discriminator = "type"
    _one_of = [
        Cat(),
        Dog(),
    ]

# If more specific mapping resolutions than 1-to-1 by name are needed,
# an explicit dictionary can be specified instead.
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.DeployContentType(*args, **kwargs)[source]

Base schema node with support of extended functionalities.

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

example[source]
default[source]
validator[source]
class weaver.wps_restapi.swagger_definitions.DeployHeaders(*args, **kwargs)[source]

Headers that can indicate how to adjust the behavior and/or result to be provided in the response.

x_auth_docker[source]
content_type[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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

header[source]
body[source]
class weaver.wps_restapi.swagger_definitions.UpdateInputOutputBase(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

class weaver.wps_restapi.swagger_definitions.UpdateInputOutputItem(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

class weaver.wps_restapi.swagger_definitions.UpdateInputOutputList(*args, **kwargs)[source]

Sequence schema that supports all applicable extended schema node functionalities.

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

io_item[source]
class weaver.wps_restapi.swagger_definitions.UpdateInputOutputMap(*args: Any, **kwargs: Any)[source]

Object schema that will preserve 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.

..note::

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 using preserve are passed down without any validation. Other fields that are explicitly specified with sub-schema nodes will still be validated as per usual behaviour.

See also

StrictMappingSchema

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.

io_id[source]
class weaver.wps_restapi.swagger_definitions.UpdateInputOutputDefinition(*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
# (each schema must provide the same property name)
class SomeAnimal(OneOfMappingSchema):
    discriminator = "type"
    _one_of = [
        Cat(),
        Dog(),
    ]

# If more specific mapping resolutions than 1-to-1 by name are needed,
# an explicit dictionary can be specified instead.
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.PatchProcessBodySchema(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

title[source]
description[source]
keywords[source]
metadata[source]
inputs[source]
outputs[source]
jobControlOptions[source]
outputTransmission[source]
visibility[source]
class weaver.wps_restapi.swagger_definitions.PutProcessBodySchema(*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
# (each schema must provide the same property name)
class SomeAnimal(OneOfMappingSchema):
    discriminator = "type"
    _one_of = [
        Cat(),
        Dog(),
    ]

# If more specific mapping resolutions than 1-to-1 by name are needed,
# an explicit dictionary can be specified instead.
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 = 'Process re-deployment using an updated version and definition.'[source]
class weaver.wps_restapi.swagger_definitions.PatchProcessEndpoint(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

headers[source]
querystring[source]
body[source]
class weaver.wps_restapi.swagger_definitions.PutProcessEndpoint(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

headers[source]
querystring[source]
body[source]
class weaver.wps_restapi.swagger_definitions.WpsOutputContextHeader(*args, **kwargs)[source]

Base schema node with support of extended functionalities.

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 = 'X-WPS-Output-Context'[source]
description = ('Contextual location where to store WPS output results from job execution. ', 'When provided,...[source]
schema_type[source]
missing[source]
example = 'my-directory/sub-project'[source]
default[source]
class weaver.wps_restapi.swagger_definitions.ExecuteHeadersBase(*args, **kwargs)[source]

Headers that can indicate how to adjust the behavior and/or result to be provided in the response.

description = 'Request headers supported for job execution.'[source]
x_wps_output_context[source]
class weaver.wps_restapi.swagger_definitions.ExecuteHeadersJSON(*args, **kwargs)[source]

Headers that can indicate how to adjust the behavior and/or result to be provided in the response.

content_type[source]
class weaver.wps_restapi.swagger_definitions.ExecuteHeadersXML(*args, **kwargs)[source]

Headers that can indicate how to adjust the behavior and/or result to be provided in the response.

content_type[source]
class weaver.wps_restapi.swagger_definitions.PostProcessJobsEndpointJSON(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

content_type[source]
header[source]
querystring[source]
body[source]
class weaver.wps_restapi.swagger_definitions.PostProcessJobsEndpointXML(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

content_type[source]
header[source]
querystring[source]
body[source]
class weaver.wps_restapi.swagger_definitions.PagingQueries(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

page[source]
limit[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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

detail[source]
groups[source]
min_duration[source]
max_duration[source]
datetime[source]
status[source]
processID[source]
process[source]
version[source]
service[source]
provider[source]
type[source]
sort[source]
access[source]
tags[source]
class weaver.wps_restapi.swagger_definitions.GetProcessJobsQuery(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

class weaver.wps_restapi.swagger_definitions.GetProviderJobsQueries(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

header[source]
querystring[source]
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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

header[source]
querystring[source]
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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

header[source]
querystring[source]
class weaver.wps_restapi.swagger_definitions.JobIdentifierList(*args, **kwargs)[source]

Sequence schema that supports all applicable extended schema node functionalities.

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_id[source]
class weaver.wps_restapi.swagger_definitions.DeleteJobsBodySchema(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

jobs[source]
class weaver.wps_restapi.swagger_definitions.DeleteJobsEndpoint(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

header[source]
body[source]
class weaver.wps_restapi.swagger_definitions.DeleteProcessJobsEndpoint(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

querystring[source]
class weaver.wps_restapi.swagger_definitions.DeleteProviderJobsEndpoint(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • 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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

header[source]
querystring[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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

header[source]
querystring[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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • 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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • 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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

header[source]
querystring[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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

header[source]
querystring[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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • 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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • 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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

header[source]
querystring[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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

header[source]
body[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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

header[source]
querystring[source]
body[source]
class weaver.wps_restapi.swagger_definitions.ProvidersQuerySchema(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

detail[source]
check[source]
ignore[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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

querystring[source]
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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

header[source]
body[source]
class weaver.wps_restapi.swagger_definitions.ProcessDetailQuery(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

detail[source]
class weaver.wps_restapi.swagger_definitions.ProcessLinksQuery(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

class weaver.wps_restapi.swagger_definitions.ProcessRevisionsQuery(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

process[source]
revisions[source]
class weaver.wps_restapi.swagger_definitions.ProviderProcessesQuery(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

class weaver.wps_restapi.swagger_definitions.ProviderProcessesEndpoint(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

header[source]
querystring[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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • 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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

code[source]
status[source]
class weaver.wps_restapi.swagger_definitions.OWSErrorCode(*args, **kwargs)[source]

Base schema node with support of extended functionalities.

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 or URI reference that identifies the problem type.'[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.ErrorCause(*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
# (each schema must provide the same property name)
class SomeAnimal(OneOfMappingSchema):
    discriminator = "type"
    _one_of = [
        Cat(),
        Dog(),
    ]

# If more specific mapping resolutions than 1-to-1 by name are needed,
# an explicit dictionary can be specified instead.
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.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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

_schema[source]
description = 'JSON schema for exceptions based on RFC 7807'[source]
type[source]
title[source]
detail[source]
status[source]
cause[source]
value[source]
error[source]
instance[source]
exception[source]
class weaver.wps_restapi.swagger_definitions.ServerErrorBaseResponseSchema(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

_schema[source]
class weaver.wps_restapi.swagger_definitions.BadRequestResponseSchema(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

description = 'Incorrectly formed request contents.'[source]
header[source]
body[source]
class weaver.wps_restapi.swagger_definitions.ConflictRequestResponseSchema(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

description = 'Conflict between the affected entity and another existing definition.'[source]
header[source]
body[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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

description = 'Wrong format of given parameters.'[source]
header[source]
body[source]
class weaver.wps_restapi.swagger_definitions.UnsupportedMediaTypeResponseSchema(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

_schema[source]
description = 'Media-Type not supported for this request.'[source]
header[source]
body[source]
class weaver.wps_restapi.swagger_definitions.MethodNotAllowedErrorResponseSchema(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

_schema[source]
description = 'HTTP method not allowed for requested path.'[source]
header[source]
body[source]
class weaver.wps_restapi.swagger_definitions.NotFoundResponseSchema(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

_schema[source]
description = 'Requested resource could not be found.'[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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • 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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

description = 'Referenced provider is not accessible.'[source]
header[source]
body[source]
class weaver.wps_restapi.swagger_definitions.ForbiddenProviderLocalResponseSchema(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

description[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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • 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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

_schema[source]
header[source]
body[source]
class weaver.wps_restapi.swagger_definitions.OpenAPIResponseContentTypeHeader(*args, **kwargs)[source]

Base schema node with support of extended functionalities.

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

example[source]
default[source]
validator[source]
class weaver.wps_restapi.swagger_definitions.OpenAPIResponseHeaders(*args, **kwargs)[source]

Headers describing resulting response.

content_type[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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

header[source]
body[source]
examples[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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • 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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • 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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • 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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • 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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • 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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • 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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • 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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • 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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • 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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

providers[source]
ignore[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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

querystring[source]
class weaver.wps_restapi.swagger_definitions.ProviderProcessesListing(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

_schema[source]
_sort_first = ['id', 'processes'][source]
id[source]
class weaver.wps_restapi.swagger_definitions.ProviderProcessesList(*args, **kwargs)[source]

Sequence schema that supports all applicable extended schema node functionalities.

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.ProvidersProcessesCollection(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

providers[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

class weaver.wps_restapi.swagger_definitions.ProcessListingMetadata(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

description = 'Metadata relative to the listed processes.'[source]
total[source]
class weaver.wps_restapi.swagger_definitions.ProcessesListing(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

_schema[source]
_sort_first[source]
_sort_after[source]
class weaver.wps_restapi.swagger_definitions.MultiProcessesListing(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

_schema_meta_include = True[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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

_schema[source]
description = 'Listing of available processes successful.'[source]
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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

description[source]
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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

description = 'Process successfully deployed.'[source]
header[source]
body[source]
class weaver.wps_restapi.swagger_definitions.OkPatchProcessUpdatedBodySchema(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

description[source]
processSummary[source]
class weaver.wps_restapi.swagger_definitions.OkPatchProcessResponse(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

description = 'Process successfully updated.'[source]
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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

description = 'Missing process identifier.'[source]
body[source]
class weaver.wps_restapi.swagger_definitions.NotFoundProcessResponse(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

description = 'Process with specified reference identifier does not exist.'[source]
examples[source]
header[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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • 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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • 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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • 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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • 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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • 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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • 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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • 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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • 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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

description = 'Process successfully undeployed.'[source]
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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • 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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • 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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

description = 'Provider registration not supported using specified definition.'[source]
class weaver.wps_restapi.swagger_definitions.PreferenceAppliedHeader(*args, **kwargs)[source]

Base schema node with support of extended functionalities.

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 = "Applied preferences from submitted 'Prefer' header after validation."[source]
name = 'Preference-Applied'[source]
schema_type[source]
example = 'wait=10s, respond-async'[source]
class weaver.wps_restapi.swagger_definitions.LocationHeader(*args, **kwargs)[source]

Base schema node with support of extended functionalities.

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 = 'Location'[source]
class weaver.wps_restapi.swagger_definitions.CreatedJobLocationHeader(*args, **kwargs)[source]

Headers describing resulting response.

location[source]
prefer_applied[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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

description = 'Job successfully submitted to processing queue. Execution should begin when resources are available.'[source]
examples[source]
header[source]
body[source]
class weaver.wps_restapi.swagger_definitions.CompletedJobLocationHeader(*args, **kwargs)[source]

Headers describing resulting response.

location[source]
prefer_applied[source]
class weaver.wps_restapi.swagger_definitions.CompletedJobStatusSchema(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

class weaver.wps_restapi.swagger_definitions.CompletedJobResponse(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

description = 'Job submitted and completed execution synchronously.'[source]
header[source]
body[source]
class weaver.wps_restapi.swagger_definitions.FailedSyncJobResponse(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

description = 'Job submitted and failed synchronous execution. See server logs for more details.'[source]
class weaver.wps_restapi.swagger_definitions.InvalidJobParametersResponse(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

description = 'Job parameters failed validation.'[source]
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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • 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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

header[source]
body[source]
class weaver.wps_restapi.swagger_definitions.BatchDismissJobsBodySchema(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

jobs[source]
class weaver.wps_restapi.swagger_definitions.OkBatchDismissJobsResponseSchema(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • 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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • 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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

_schema[source]
header[source]
body[source]
class weaver.wps_restapi.swagger_definitions.InvalidJobResponseSchema(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

description = 'Job reference is not a valid UUID.'[source]
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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

description = 'Job reference UUID cannot be found.'[source]
examples[source]
header[source]
body[source]
class weaver.wps_restapi.swagger_definitions.GoneJobResponseSchema(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

description = 'Job reference UUID cannot be dismissed again or its result artifacts were removed.'[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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • 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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • 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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • 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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

_schema[source]
header[source]
body[source]
class weaver.wps_restapi.swagger_definitions.NoContentJobResultsHeaders(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

content_length[source]
class weaver.wps_restapi.swagger_definitions.NoContentJobResultsResponse(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • 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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

header[source]
body[source]
class weaver.wps_restapi.swagger_definitions.CreatedQuoteResponse(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

description = 'Quote successfully obtained for process execution definition.'[source]
header[source]
body[source]
class weaver.wps_restapi.swagger_definitions.AcceptedQuoteResponse(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

summary = 'Quote successfully submitted.'[source]
description = 'Quote successfully submitted for evaluating process execution definition. Complete details will...'[source]
header[source]
body[source]
class weaver.wps_restapi.swagger_definitions.QuotePaymentRequiredResponse(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

description = 'Quoted process execution refused due to missing payment.'[source]
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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

header[source]
body[source]
class weaver.wps_restapi.swagger_definitions.NotFoundQuoteResponse(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

description = 'Quote with specified reference identifier does not exist.'[source]
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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

header[source]
body[source]
class weaver.wps_restapi.swagger_definitions.OkGetEstimatorResponse(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

header[source]
body[source]
class weaver.wps_restapi.swagger_definitions.OkPutEstimatorResponse(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

header[source]
body[source]
class weaver.wps_restapi.swagger_definitions.OkDeleteEstimatorResponse(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • 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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • 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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • 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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • 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

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

header[source]
body[source]
class weaver.wps_restapi.swagger_definitions.OkGetJobStatsResponse(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

header[source]
body[source]
class weaver.wps_restapi.swagger_definitions.VaultFileID(*args, **kwargs)[source]

Base schema node with support of extended functionalities.

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 = 'Vault file identifier.'[source]
example = '78977deb-28af-46f3-876b-cdd272742678'[source]
class weaver.wps_restapi.swagger_definitions.VaultAccessToken(*args, **kwargs)[source]

Base schema node with support of extended functionalities.

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 = 'Vault file access token.'[source]
example = '30d889cfb7ae3a63229a8de5f91abc1ef5966bb664972f234a4db9d28f8148e0e'[source]
class weaver.wps_restapi.swagger_definitions.VaultEndpoint(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

header[source]
class weaver.wps_restapi.swagger_definitions.VaultUploadBody(*args, **kwargs)[source]

Base schema node with support of extended functionalities.

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 = 'Multipart file contents for upload to the vault.'[source]
examples[source]
class weaver.wps_restapi.swagger_definitions.VaultUploadEndpoint(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

header[source]
body[source]
class weaver.wps_restapi.swagger_definitions.VaultFileUploadedBodySchema(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

access_token[source]
file_id[source]
file_href[source]
class weaver.wps_restapi.swagger_definitions.VaultFileUploadedHeaders(*args, **kwargs)[source]

Headers describing resulting response.

location[source]
class weaver.wps_restapi.swagger_definitions.OkVaultFileUploadedResponse(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

description = 'File successfully uploaded to vault.'[source]
header[source]
body[source]
class weaver.wps_restapi.swagger_definitions.BadRequestVaultFileUploadResponse(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

description = 'Missing or incorrectly formed file contents.'[source]
header[source]
body[source]
class weaver.wps_restapi.swagger_definitions.UnprocessableEntityVaultFileUploadResponse(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

description = 'Invalid filename refused for upload. Filename should include only alphanumeric, underscore,...'[source]
header[source]
body[source]
class weaver.wps_restapi.swagger_definitions.XAuthVaultFileHeader(*args, **kwargs)[source]

Base schema node with support of extended functionalities.

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

summary = 'Authorization header with token for Vault file access.'[source]
description[source]
name = 'X-Auth-Vault'[source]
example = 'token {access-token}[; id={vault-id}]'[source]
schema_type[source]
class weaver.wps_restapi.swagger_definitions.VaultFileRequestHeaders(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

access_token[source]
class weaver.wps_restapi.swagger_definitions.VaultFileEndpoint(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

header[source]
file_id[source]
class weaver.wps_restapi.swagger_definitions.OkVaultFileDetailResponse(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

header[source]
body[source]
class weaver.wps_restapi.swagger_definitions.OkVaultFileDownloadResponse(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

class weaver.wps_restapi.swagger_definitions.BadRequestVaultFileAccessResponse(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

description = 'Invalid file vault reference.'[source]
header[source]
body[source]
class weaver.wps_restapi.swagger_definitions.ForbiddenVaultFileDownloadResponse(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

description = 'Forbidden access to vault file. Invalid authorization from provided token.'[source]
header[source]
body[source]
class weaver.wps_restapi.swagger_definitions.GoneVaultFileDownloadResponse(*args, **kwargs)[source]

Combines multiple extensions of colander.MappingSchema handle their corresponding keywords.

Resolution is done so that default keyword is used first to resolve a missing object during deserialize() call, and then removes the node completely if no default was provided.

See also

  • DefaultSchemaNode

  • DropableSchemaNode

  • VariableSchemaNode

  • ExtendedSchemaNode

  • ExtendedSequenceSchema

  • SchemaRefMappingSchema

  • SortableMappingSchema

  • PermissiveMappingSchema

description = 'Vault File resource corresponding to specified ID is not available anymore.'[source]
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.put_process_responses[source]
weaver.wps_restapi.swagger_definitions.patch_process_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.get_provider_process_package_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.delete_jobs_responses[source]
weaver.wps_restapi.swagger_definitions.get_prov_all_jobs_responses[source]
weaver.wps_restapi.swagger_definitions.get_single_job_status_responses[source]
weaver.wps_restapi.swagger_definitions.get_prov_single_job_status_responses[source]
weaver.wps_restapi.swagger_definitions.delete_job_responses[source]
weaver.wps_restapi.swagger_definitions.delete_prov_job_responses[source]
weaver.wps_restapi.swagger_definitions.get_job_inputs_responses[source]
weaver.wps_restapi.swagger_definitions.get_prov_inputs_responses[source]
weaver.wps_restapi.swagger_definitions.get_job_outputs_responses[source]
weaver.wps_restapi.swagger_definitions.get_prov_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_prov_results_responses[source]
weaver.wps_restapi.swagger_definitions.get_exceptions_responses[source]
weaver.wps_restapi.swagger_definitions.get_prov_exceptions_responses[source]
weaver.wps_restapi.swagger_definitions.get_logs_responses[source]
weaver.wps_restapi.swagger_definitions.get_prov_logs_responses[source]
weaver.wps_restapi.swagger_definitions.get_stats_responses[source]
weaver.wps_restapi.swagger_definitions.get_prov_stats_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_process_quote_estimator_responses[source]
weaver.wps_restapi.swagger_definitions.put_process_quote_estimator_responses[source]
weaver.wps_restapi.swagger_definitions.delete_process_quote_estimator_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.post_vault_responses[source]
weaver.wps_restapi.swagger_definitions.head_vault_file_responses[source]
weaver.wps_restapi.swagger_definitions.get_vault_file_responses[source]
weaver.wps_restapi.swagger_definitions.wps_responses[source]
weaver.wps_restapi.swagger_definitions.service_api_route_info(service_api: weaver.wps_restapi.patches.ServiceOnlyExplicitGetHead, settings: weaver.typedefs.SettingsType) ViewInfo[source]

Automatically generates the view configuration parameters from the cornice service definition.

Parameters:
  • service_api – cornice service with name and path definition.

  • settings – settings to obtain the base path of the application.

Returns:

view configuration parameters that can be passed directly to config.add_route call.

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.swagger_definitions.validate_node_schema(schema_node: weaver.wps_restapi.colander_extras.ExtendedMappingSchema, cstruct: weaver.typedefs.JSON) weaver.typedefs.JSON[source]

Validate a schema node defined against a reference schema within WEAVER_SCHEMA_DIR.

If the reference contains an anchor (e.g.: #/definitions/Def), the sub-schema of that reference will be used for validation against the data structure.

weaver.wps_restapi.utils
Module Contents
weaver.wps_restapi.utils.LOGGER[source]
exception weaver.wps_restapi.utils.HTTPHeadFileResponse(code: int = 200, headers: weaver.typedefs.HeadersType | None = None, **kwargs: Any)[source]

Provides additional header handing when returning a response to HTTP HEAD request.

When returning from HTTP HEAD, the body contents are omitted from the response. The response MUST NOT contain the body contents, but the HTTP headers SHOULD be identical to the corresponding HTTP GET request.

Note

Even though no content is provided for HEAD response, 204 SHOULD NOT be used since it must emulate the GET response that would contain the content.

When setting HTTPException.empty_body on pyramid.httpexceptions.HTTPException derived classes, pyramid incorrectly drops important headers such as Content-Type and Content-Length that should be reported as if the file was returned when the represented entity is a file, although no content is actually present. When instead the body is omitted (text="" or body=b''), the HTTPException.prepare() method also incorrectly overrides the Content-Type and Content-Length values. Finally, Content-Length also gets recalculated when the content iterator is created from the initialization parameters. This class takes care of all these edge cases to properly report content headers of HEAD requests although none is provided.

Initialize self. See help(type(self)) for accurate signature.

prepare(environ)[source]

No contents for HEAD request.

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]
weaver.wps_restapi.utils.get_schema_ref(schema: colander.SchemaNode, container: weaver.typedefs.AnySettingsContainer | None = None, ref_type: str = '$id', ref_name: True = True) Dict[str, str][source]

Generates the JSON OpenAPI schema reference relative to the current Weaver instance.

The provided schema should be one of the items listed in #/definitions of the /json endpoint. No validation is accomplished to avoid long processing of all references.

If setting weaver.schema_url is set, this value will be used direct as fully-defined base URL. This could be used to refer to a static endpoint where schemas are hosted. Otherwise, the current Web Application resolved location is employed with JSON OpenAPI path.

Parameters:
  • schema – schema-node instance or type for which to generate the OpenAPI reference.

  • container – application settings to retrieve the base URL of the schema location.

  • ref_type – key employed to form the reference (e.g.: “$id”, “$ref”, “$schema”, “@id”, etc.).

  • ref_name – indicate if the plain name should also be included under field "schema".

Returns:

OpenAPI schema reference

weaver.wps_restapi.utils.handle_schema_validation(schema: colander.SchemaNode | None = None) weaver.typedefs.AnyCallableWrapped[source]

Convert a schema validation error into an HTTP error with error details about the failure.

Parameters:

schema – If provided, document this schema as the reference of the failed schema validation.

Raises:

HTTPBadRequest – If any schema validation error occurs when handling the decorated function.

weaver.wps_restapi.utils.parse_content(request: weaver.typedefs.AnyRequestType | None = None, content: weaver.typedefs.JSON | str | None = None, content_schema: colander.SchemaNode | None = None, content_type: weaver.formats.ContentType | None = sd.RequestContentTypeHeader.default, content_type_schema: colander.SchemaNode | None = sd.RequestContentTypeHeader) weaver.typedefs.JSON | weaver.typedefs.CWL[source]

Load the request content with validation of expected content type and their schema.

Package Contents
weaver.wps_restapi.LOGGER[source]
weaver.wps_restapi.includeme(config: pyramid.config.Configurator) None[source]
Submodules
weaver.app

Weaver Web Application (weaver-manager).

Module Contents
weaver.app.LOGGER[source]
weaver.app.main(global_config: weaver.typedefs.SettingsType, **settings: Any) pyramid.router.Router[source]

Creates a Pyramid WSGI application for Weaver.

weaver.base

Definitions of base classes employed across multiple modules to avoid circular import errors.

Module Contents
weaver.base.PropertyDataTypeT[source]
class weaver.base._Const[source]
abstract get(key)[source]
class weaver.base.Constants[source]

Constants container that provides similar functionalities to ExtendedEnum without explicit Enum membership.

classmethod get(key_or_value: weaver.typedefs.AnyKey | EnumType | PropertyDataTypeT, default: Any | None = None) PropertyDataTypeT[source]
classmethod docs() Dict[str, str | None][source]

Retrieves the documentation string applied on the attribute.

Employ classproperty to define the attributes.

classmethod names() List[str][source]

Returns the member names assigned to corresponding enum elements.

classmethod values() List[weaver.typedefs.AnyKey][source]

Returns the literal values assigned to corresponding enum elements.

class weaver.base.classproperty(fget: Callable[[object], PropertyDataTypeT] | None = None, fset: Callable[[object, PropertyDataTypeT], None] | None = None, fdel: Callable[[object], None] | None = None, doc: str = '')[source]

Mimics property decorator, but applied onto classmethod in backward compatible way.

Note

This decorator purposely only supports getter attribute to define unmodifiable class properties.

Initialize self. See help(type(self)) for accurate signature.

class weaver.base._EnumMeta[source]

Metaclass for Enum

abstract get(key)[source]
class weaver.base.ExtendedEnum[source]

Utility enum.Enum methods.

Create an extended enum with these utilities as follows.

class CustomEnum(ExtendedEnum):
    ItemA = "A"
    ItemB = "B"

Warning

Must not define any enum value here to allow inheritance by subclasses.

property title: str[source]

Returns the title representation of the enum element.

Title use the original enum element name with capitalization considering underscores for separate words.

classmethod names() List[str][source]

Returns the member names assigned to corresponding enum elements.

classmethod values() List[weaver.typedefs.AnyKey][source]

Returns the literal values assigned to corresponding enum elements.

classmethod get(key_or_value: weaver.typedefs.AnyKey | EnumType, default: Any | None = None) EnumType | None[source]

Finds an enum entry by defined name or its value.

Returns the entry directly if it is already a valid enum.

classmethod titles() List[str][source]

Returns the title representation of all enum elements.

weaver.base.EnumType[source]
weaver.cli
Module Contents
weaver.cli.AnyRequestMethod[source]
weaver.cli.LOGGER[source]
weaver.cli.OPERATION_ARGS_TITLE = 'Operation Arguments'[source]
weaver.cli.OPTIONAL_ARGS_TITLE = 'Optional Arguments'[source]
weaver.cli.REQUIRED_ARGS_TITLE = 'Required Arguments'[source]
class weaver.cli.OperationResult(success: bool | None = None, message: str | None = None, body: str | weaver.typedefs.JSON | None = None, headers: weaver.typedefs.AnyHeadersContainer | None = None, text: str | None = None, code: int | None = None, **kwargs)[source]

Data container for any WeaverClient operation results.

Parameters:
  • success – Success status of the operation.

  • message – Detail extracted from response content if available.

  • headers – Headers returned by the response for reference.

  • body – Content of JSON response or fallback in plain text.

  • text – Pre-formatted text representation of body.

Initialize self. See help(type(self)) for accurate signature.

property text: str[source]
success: bool | None = False[source]
message: str | None = ''[source]
headers: weaver.typedefs.AnyHeadersContainer | None[source]
body: weaver.typedefs.JSON | str | None[source]
code: int | None[source]

Obtain HTTP headers sorted in the result that corresponds to any link reference.

Parameters:

header_names – Limit link names to be considered. By default, considered headers are Link, Content-Location and Location.

class weaver.cli.AuthHandler(identity: str | None = None, password: str | None = None, url: str | None = None, method: weaver.typedefs.AnyRequestMethod = 'GET', headers: weaver.typedefs.AnyHeadersContainer | None = None)[source]

Base class that all auth implementations derive from

url: str | None[source]
method: weaver.typedefs.AnyRequestMethod = 'GET'[source]
headers: weaver.typedefs.AnyHeadersContainer | None[source]
identity: str | None[source]
password: str | None[source]
class weaver.cli.BasicAuthHandler(username: str, password: str, **kwargs: Any)[source]

Adds the Authorization header formed from basic authentication encoding of username and password to the request.

Authentication URL and method are not needed for this handler.

property username: str[source]
class weaver.cli.RequestAuthHandler(identity: str | None = None, password: str | None = None, url: str | None = None, method: weaver.typedefs.AnyRequestMethod = 'GET', headers: weaver.typedefs.AnyHeadersContainer | None = None)[source]

Base class to send a request in order to retrieve an authorization token.

property auth_token_name: str[source]

Override token name to retrieve in response authentication handler implementation.

Default looks amongst common names: [auth, access_token, token]

abstract auth_header(token: str) weaver.typedefs.AnyHeadersContainer[source]

Obtain the header definition with the provided authorization token.

request_auth() str | None[source]

Performs a request using authentication parameters to retrieve the authorization token.

response_parser(response: requests.Response) str | None[source]

Parses a valid authentication response to extract the received authorization token.

class weaver.cli.BearerAuthHandler(identity: str | None = None, password: str | None = None, url: str | None = None, method: weaver.typedefs.AnyRequestMethod = 'GET', headers: weaver.typedefs.AnyHeadersContainer | None = None)[source]

Adds the Authorization header formed of the authentication bearer token from the underlying request.

auth_header(token: str) weaver.typedefs.AnyHeadersContainer[source]

Obtain the header definition with the provided authorization token.

class weaver.cli.CookieAuthHandler(identity: str | None = None, password: str | None = None, url: str | None = None, method: weaver.typedefs.AnyRequestMethod = 'GET', headers: weaver.typedefs.AnyHeadersContainer | None = None)[source]

Adds the Authorization header formed of the authentication bearer token from the underlying request.

auth_header(token: str) weaver.typedefs.AnyHeadersContainer[source]

Obtain the header definition with the provided authorization token.

class weaver.cli.WeaverClient(url: str | None = None, auth: AuthHandler | None = None)[source]

Client that handles common HTTP requests with a Weaver or similar OGC API - Processes instance.

Initialize the client with predefined parameters.

Parameters:
  • url – Instance URL to employ for each method call. Must be provided each time if not defined here.

  • auth – Instance authentication handler that will be applied for every request. For specific authentication method on per-request basis, parameter should be provided to respective methods. Should perform required adjustments to request to allow access control of protected contents.

monitor_timeout = 60[source]
monitor_interval = 5[source]
auth: AuthHandler[source]
processes[source]

Alias of capabilities() for Process listing.

errors[source]
stats[source]
_request(method: weaver.typedefs.AnyRequestMethod, url: str, headers: weaver.typedefs.AnyHeadersContainer | None = None, x_headers: weaver.typedefs.AnyHeadersContainer | None = None, request_timeout: int | None = None, request_retries: int | None = None, **kwargs) weaver.typedefs.AnyResponseType[source]
_get_url(url: str | None) str[source]
static _parse_url(url)[source]
static _parse_result(response: requests.Response | OperationResult, body: weaver.typedefs.JSON | None = None, message: str | None = None, success: bool | None = None, with_headers: bool = False, with_links: bool = True, nested_links: str | None = None, output_format: weaver.formats.AnyOutputFormat | None = None, content_type: weaver.formats.ContentType | None = None) OperationResult[source]
static _parse_deploy_body(body: weaver.typedefs.JSON | str | None, process_id: str | None) OperationResult[source]
static _parse_deploy_package(body: weaver.typedefs.JSON, cwl: weaver.typedefs.CWL | None, wps: str | None, process_id: str | None, headers: weaver.typedefs.HeadersType) OperationResult[source]
_parse_job_ref(job_reference: str, url: str | None = None) Tuple[str | None, str | None][source]
static _parse_auth_token(token: str | None, username: str | None, password: str | None) weaver.typedefs.HeadersType[source]
register(provider_id: str, provider_url: str, url: str | None = None, auth: AuthHandler | None = None, headers: weaver.typedefs.AnyHeadersContainer | None = None, with_links: bool = True, with_headers: bool = False, request_timeout: int | None = None, request_retries: int | None = None, output_format: weaver.formats.AnyOutputFormat | None = None) OperationResult[source]

Registers a remote Provider using specified references.

Note

This operation is specific to Weaver. It is not supported by standard OGC API - Processes.

Parameters:
  • provider_id – Identifier to employ for registering the new Provider.

  • provider_url – Endpoint location to register the new remote Provider.

  • url – Instance URL if not already provided during client creation.

  • auth – Instance authentication handler if not already created during client creation. Should perform required adjustments to request to allow access control of protected contents.

  • headers – Additional headers to employ when sending request. Note that this can break functionalities if expected headers are overridden. Use with care.

  • with_links – Indicate if links section should be preserved in returned result body.

  • with_headers – Indicate if response headers should be returned in result output.

  • request_timeout – Maximum timout duration (seconds) to wait for a response when performing HTTP requests.

  • request_retries – Amount of attempt to retry HTTP requests in case of failure.

  • output_format – Select an alternate output representation of the result body contents.

Returns:

Results of the operation.

unregister(provider_id: str, url: str | None = None, auth: AuthHandler | None = None, headers: weaver.typedefs.AnyHeadersContainer | None = None, with_links: bool = True, with_headers: bool = False, request_timeout: int | None = None, request_retries: int | None = None, output_format: weaver.formats.AnyOutputFormat | None = None) OperationResult[source]

Unregisters a remote Provider using the specified identifier.

Note

This operation is specific to Weaver. It is not supported by standard OGC API - Processes.

Parameters:
  • provider_id – Identifier to employ for unregistering the Provider.

  • url – Instance URL if not already provided during client creation.

  • auth – Instance authentication handler if not already created during client creation. Should perform required adjustments to request to allow access control of protected contents.

  • headers – Additional headers to employ when sending request. Note that this can break functionalities if expected headers are overridden. Use with care.

  • with_links – Indicate if links section should be preserved in returned result body.

  • with_headers – Indicate if response headers should be returned in result output.

  • request_timeout – Maximum timout duration (seconds) to wait for a response when performing HTTP requests.

  • request_retries – Amount of attempt to retry HTTP requests in case of failure.

  • output_format – Select an alternate output representation of the result body contents.

Returns:

Results of the operation.

deploy(process_id: str | None = None, body: weaver.typedefs.JSON | str | None = None, cwl: weaver.typedefs.CWL | str | None = None, wps: str | None = None, token: str | None = None, username: str | None = None, password: str | None = None, undeploy: bool = False, url: str | None = None, auth: AuthHandler | None = None, headers: weaver.typedefs.AnyHeadersContainer | None = None, with_links: bool = True, with_headers: bool = False, request_timeout: int | None = None, request_retries: int | None = None, output_format: weaver.formats.AnyOutputFormat | None = None) OperationResult[source]

Deploy a new Process with specified metadata and reference to an Application Package.

The referenced Application Package must be one of: - CWL body, local file or URL in JSON or YAML format - WPS process URL with XML response - WPS-REST process URL with JSON response - OGC API - Processes process URL with JSON response

If the reference is resolved to be a Workflow, all its underlying Process steps must be available under the same URL that this client was initialized with.

Note

This is only supported by OGC API - Processes instances that support the Deploy, Replace, Undeploy (DRU) extension.

Parameters:
  • process_id – Desired process identifier. Can be omitted if already provided in body contents or file.

  • body – Literal JSON contents, either using string representation of actual Python objects forming the request body, or file path/URL to YAML or JSON contents of the request body. Other parameters (process_id, cwl) can override corresponding fields within the provided body.

  • cwl – Literal JSON or YAML contents, either using string representation of actual Python objects, or file path/URL with contents of the CWL definition of the Application package to be inserted into the body.

  • wps – URL to an existing WPS process (WPS-1/2 or WPS-REST/OGC-API).

  • token – Authentication token for accessing private Docker registry if CWL refers to such image.

  • username – Username to form the authentication token to a private Docker registry.

  • password – Password to form the authentication token to a private Docker registry.

  • undeploy – Perform undeploy as necessary before deployment to avoid conflict with exiting Process.

  • url – Instance URL if not already provided during client creation.

  • auth – Instance authentication handler if not already created during client creation. Should perform required adjustments to request to allow access control of protected contents.

  • headers – Additional headers to employ when sending request. Note that this can break functionalities if expected headers are overridden. Use with care.

  • with_links – Indicate if links section should be preserved in returned result body.

  • with_headers – Indicate if response headers should be returned in result output.

  • request_timeout – Maximum timout duration (seconds) to wait for a response when performing HTTP requests.

  • request_retries – Amount of attempt to retry HTTP requests in case of failure.

  • output_format – Select an alternate output representation of the result body contents.

Returns:

Results of the operation.

undeploy(process_id: str, url: str | None = None, auth: AuthHandler | None = None, headers: weaver.typedefs.AnyHeadersContainer | None = None, with_links: bool = True, with_headers: bool = False, request_timeout: int | None = None, request_retries: int | None = None, output_format: weaver.formats.AnyOutputFormat | None = None) OperationResult[source]

Undeploy an existing Process.

Parameters:
  • process_id – Identifier of the process to undeploy.

  • url – Instance URL if not already provided during client creation.

  • auth – Instance authentication handler if not already created during client creation. Should perform required adjustments to request to allow access control of protected contents.

  • headers – Additional headers to employ when sending request. Note that this can break functionalities if expected headers are overridden. Use with care.

  • with_links – Indicate if links section should be preserved in returned result body.

  • with_headers – Indicate if response headers should be returned in result output.

  • request_timeout – Maximum timout duration (seconds) to wait for a response when performing HTTP requests.

  • request_retries – Amount of attempt to retry HTTP requests in case of failure.

  • output_format – Select an alternate output representation of the result body contents.

Returns:

Results of the operation.

capabilities(url: str | None = None, auth: AuthHandler | None = None, headers: weaver.typedefs.AnyHeadersContainer | None = None, with_links: bool = True, with_headers: bool = False, with_providers: bool = False, request_timeout: int | None = None, request_retries: int | None = None, output_format: weaver.formats.AnyOutputFormat | None = None, sort: weaver.sort.Sort | None = None, page: int | None = None, limit: int | None = None, detail: bool = False) OperationResult[source]

List all available Process on the instance.

Parameters:
  • url – Instance URL if not already provided during client creation.

  • auth – Instance authentication handler if not already created during client creation. Should perform required adjustments to request to allow access control of protected contents.

  • headers – Additional headers to employ when sending request. Note that this can break functionalities if expected headers are overridden. Use with care.

  • with_links – Indicate if links section should be preserved in returned result body.

  • with_headers – Indicate if response headers should be returned in result output.

  • with_providers – Indicate if remote providers should be listed as well along with local processes.

  • request_timeout – Maximum timout duration (seconds) to wait for a response when performing HTTP requests.

  • request_retries – Amount of attempt to retry HTTP requests in case of failure.

  • output_format – Select an alternate output representation of the result body contents.

  • sort – Sorting field to list processes. Name must be one of the fields supported by process objects.

  • page – Paging index to list processes.

  • limit – Amount of processes to list per page.

  • detail – Obtain detailed process descriptions.

Returns:

Results of the operation.

describe(process_id: str, provider_id: str | None = None, url: str | None = None, auth: AuthHandler | None = None, headers: weaver.typedefs.AnyHeadersContainer | None = None, schema: weaver.processes.constants.ProcessSchemaType | None = ProcessSchema.OGC, with_links: bool = True, with_headers: bool = False, request_timeout: int | None = None, request_retries: int | None = None, output_format: weaver.formats.AnyOutputFormat | None = None) OperationResult[source]

Describe the specified Process.

Parameters:
  • process_id – Identifier of the local or remote process to describe.

  • provider_id – Identifier of the provider from which to locate a remote process to describe.

  • url – Instance URL if not already provided during client creation.

  • auth – Instance authentication handler if not already created during client creation. Should perform required adjustments to request to allow access control of protected contents.

  • headers – Additional headers to employ when sending request. Note that this can break functionalities if expected headers are overridden. Use with care.

  • schema – Representation schema of the returned process description.

  • with_links – Indicate if links section should be preserved in returned result body.

  • with_headers – Indicate if response headers should be returned in result output.

  • request_timeout – Maximum timout duration (seconds) to wait for a response when performing HTTP requests.

  • request_retries – Amount of attempt to retry HTTP requests in case of failure.

  • output_format – Select an alternate output representation of the result body contents.

Returns:

Results of the operation.

_get_process_url(url: str, process_id: str, provider_id: str | None = None) str[source]
package(process_id: str, provider_id: str | None = None, url: str | None = None, auth: AuthHandler | None = None, headers: weaver.typedefs.AnyHeadersContainer | None = None, with_links: bool = True, with_headers: bool = False, request_timeout: int | None = None, request_retries: int | None = None, output_format: weaver.formats.AnyOutputFormat | None = None) OperationResult[source]

Retrieve the Application Package definition of the specified Process.

Note

This operation is specific to Weaver. It is not supported by standard OGC API - Processes.

Parameters:
  • process_id – Identifier of the local or remote process to describe.

  • provider_id – Identifier of the provider from which to locate a remote process to describe.

  • url – Instance URL if not already provided during client creation.

  • auth – Instance authentication handler if not already created during client creation. Should perform required adjustments to request to allow access control of protected contents.

  • headers – Additional headers to employ when sending request. Note that this can break functionalities if expected headers are overridden. Use with care.

  • with_links – Indicate if links section should be preserved in returned result body.

  • with_headers – Indicate if response headers should be returned in result output.

  • request_timeout – Maximum timout duration (seconds) to wait for a response when performing HTTP requests.

  • request_retries – Amount of attempt to retry HTTP requests in case of failure.

  • output_format – Select an alternate output representation of the result body contents.

Returns:

Results of the operation.

static _parse_inputs(inputs: str | weaver.typedefs.JSON | None) OperationResult | weaver.typedefs.ExecutionInputsMap[source]

Parse multiple different representation formats and input sources into standard OGC inputs.

Schema OGC is selected to increase compatibility coverage with potential non-Weaver servers only conforming to standard OGC API - Processes.

Inputs can be represented as CLI option string arguments, file path to load contents from, or directly supported list or mapping of execution inputs definitions.

_upload_files(inputs: weaver.typedefs.ExecutionInputsMap, url: str | None = None) Tuple[weaver.typedefs.ExecutionInputsMap, weaver.typedefs.HeadersType] | OperationResult[source]

Replaces local file paths by references uploaded to the Vault.

See also

Parameters:

inputs – Input values for submission of Process execution.

Returns:

Updated inputs or the result of a failing intermediate request.

execute(process_id: str, provider_id: str | None = None, inputs: str | weaver.typedefs.JSON | None = None, monitor: bool = False, timeout: int | None = None, interval: int | None = None, subscribers: weaver.typedefs.JobSubscribers | None = None, url: str | None = None, auth: AuthHandler | None = None, headers: weaver.typedefs.AnyHeadersContainer | None = None, with_links: bool = True, with_headers: bool = False, request_timeout: int | None = None, request_retries: int | None = None, output_format: weaver.formats.AnyOutputFormat | None = None, output_refs: Iterable[str] | None = None, output_context: str | None = None) OperationResult[source]

Execute a Job for the specified Process with provided inputs.

When submitting inputs with OGC API - Processes schema, top-level inputs field is expected. Under this field, either the OGC mapping (key-value) or listing (id,value) representations are accepted.

If the top-level inputs field is not found, the alternative CWL representation will be assumed. When submitting inputs with CWL job schema, plain key-value(s) pairs are expected. All values should be provided directly under the key (including arrays), except for File type that must include details as the class: File and path with location.

Note

Execution requests are always accomplished asynchronously. To obtain the final Job status as if they were executed synchronously, provide the monitor argument. This offers more flexibility over servers that could decide to ignore sync/async preferences, and avoids closing/timeout connection errors that could occur for long-running processes, since status is pooled iteratively rather than waiting.

Parameters:
  • process_id – Identifier of the local or remote process to execute.

  • provider_id – Identifier of the provider from which to locate a remote process to execute.

  • inputs – Literal JSON or YAML contents of the inputs submitted and inserted into the execution body, using either the OGC API - Processes or CWL format, or a file path/URL referring to them.

  • monitor – Automatically perform Job execution monitoring until completion or timeout to obtain final results. If requested, this operation will become blocking until either the completed status or timeout is reached.

  • timeout – Monitoring timeout (seconds) if requested.

  • interval – Monitoring interval (seconds) between job status polling requests.

  • subscribers – Job status subscribers to obtain email or callback request notifications. The subscriber keys indicate which type of subscriber and for which status the notification will be sent.

  • url – Instance URL if not already provided during client creation.

  • auth – Instance authentication handler if not already created during client creation. Should perform required adjustments to request to allow access control of protected contents.

  • headers – Additional headers to employ when sending request. Note that this can break functionalities if expected headers are overridden. Use with care.

  • with_links – Indicate if links section should be preserved in returned result body.

  • with_headers – Indicate if response headers should be returned in result output.

  • request_timeout – Maximum timout duration (seconds) to wait for a response when performing HTTP requests.

  • request_retries – Amount of attempt to retry HTTP requests in case of failure.

  • output_format – Select an alternate output representation of the result body contents.

  • output_refs – Indicates which outputs by ID to be returned as HTTP Link header reference instead of body content value. With reference transmission mode, outputs that contain literal data will be linked by text/plain file containing the data. outputs that refer to a file reference will simply contain that URL reference as link. With value transmission mode (default behavior when outputs are not specified in this list), outputs are returned as direct values (literal or href) within the response content body.

  • output_context – Specify an output context for which the Weaver instance should attempt storing the Job results under the nested location of its configured WPS outputs. Note that the instance is not required to fulfill that preference, and can ignore this value if it deems that the provided context is inadequate.

Returns:

Results of the operation.

upload(file_path: str, content_type: str | None = None, content_encoding: weaver.formats.ContentEncoding | None = None, url: str | None = None, auth: AuthHandler | None = None, headers: weaver.typedefs.AnyHeadersContainer | None = None, with_links: bool = True, with_headers: bool = False, request_timeout: int | None = None, request_retries: int | None = None, output_format: weaver.formats.AnyOutputFormat | None = None) OperationResult[source]

Upload a local file to the Vault.

Note

Feature only available for Weaver instances. Not available for standard OGC API - Processes.

See also

More details about formats and operations related to Vault are provided in File Vault Inputs and Uploading File to the Vault chapters.

Parameters:
  • file_path – Location of the file to be uploaded.

  • content_type – Explicit Content-Type of the file. This should be an IANA Media-Type, optionally with additional parameters such as charset. If not provided, attempts to guess it based on the file extension.

  • content_encoding – Specify the Content-Encoding of the file. For text use utf-8 or leave None. For binary use base64 or binary.

  • url – Instance URL if not already provided during client creation.

  • auth – Instance authentication handler if not already created during client creation. Should perform required adjustments to request to allow access control of protected contents.

  • headers – Additional headers to employ when sending request. Note that this can break functionalities if expected headers are overridden. Use with care.

  • with_links – Indicate if links section should be preserved in returned result body.

  • with_headers – Indicate if response headers should be returned in result output.

  • request_timeout – Maximum timout duration (seconds) to wait for a response when performing HTTP requests.

  • request_retries – Amount of attempt to retry HTTP requests in case of failure.

  • output_format – Select an alternate output representation of the result body contents.

Returns:

Results of the operation.

jobs(url: str | None = None, auth: AuthHandler | None = None, headers: weaver.typedefs.AnyHeadersContainer | None = None, with_links: bool = True, with_headers: bool = False, request_timeout: int | None = None, request_retries: int | None = None, output_format: weaver.formats.AnyOutputFormat | None = None, sort: weaver.sort.Sort | None = None, page: int | None = None, limit: int | None = None, status: weaver.status.AnyStatusSearch | List[weaver.status.AnyStatusSearch] | None = None, detail: bool = False, groups: bool = False, process: str | None = None, provider: str | None = None, tags: str | List[str] | None = None) OperationResult[source]

Obtain a listing of Job.

Parameters:
  • url – Instance URL if not already provided during client creation.

  • auth – Instance authentication handler if not already created during client creation. Should perform required adjustments to request to allow access control of protected contents.

  • headers – Additional headers to employ when sending request. Note that this can break functionalities if expected headers are overridden. Use with care.

  • with_links – Indicate if links section should be preserved in returned result body.

  • with_headers – Indicate if response headers should be returned in result output.

  • request_timeout – Maximum timout duration (seconds) to wait for a response when performing HTTP requests.

  • request_retries – Amount of attempt to retry HTTP requests in case of failure.

  • output_format – Select an alternate output representation of the result body contents.

  • sort – Sorting field to list jobs. Name must be one of the fields supported by job objects.

  • page – Paging index to list jobs.

  • limit – Amount of jobs to list per page.

  • status – Filter job listing only to matching status. If multiple are provided, must match one of them.

  • detail – Obtain detailed job descriptions.

  • groups – Obtain grouped representation of jobs per provider and process categories.

  • process – Obtain jobs executed only by matching Process.

  • provider – Obtain jobs only matching remote Provider.

  • tags – Obtain jobs filtered by matching tags. Jobs must match all tags simultaneously, not one of them.

Returns:

Retrieved status of the job.

status(job_reference: str, url: str | None = None, auth: AuthHandler | None = None, headers: weaver.typedefs.AnyHeadersContainer | None = None, with_links: bool = True, with_headers: bool = False, request_timeout: int | None = None, request_retries: int | None = None, output_format: weaver.formats.AnyOutputFormat | None = None) OperationResult[source]

Obtain the status of a Job.

Parameters:
  • job_reference – Either the full Job status URL or only its UUID.

  • url – Instance URL if not already provided during client creation.

  • auth – Instance authentication handler if not already created during client creation. Should perform required adjustments to request to allow access control of protected contents.

  • headers – Additional headers to employ when sending request. Note that this can break functionalities if expected headers are overridden. Use with care.

  • with_links – Indicate if links section should be preserved in returned result body.

  • with_headers – Indicate if response headers should be returned in result output.

  • request_timeout – Maximum timout duration (seconds) to wait for a response when performing HTTP requests.

  • request_retries – Amount of attempt to retry HTTP requests in case of failure.

  • output_format – Select an alternate output representation of the result body contents.

Returns:

Retrieved status of the Job.

_job_info(x_path: str, job_reference: str, url: str | None = None, auth: AuthHandler | None = None, headers: weaver.typedefs.AnyHeadersContainer | None = None, with_links: bool = True, with_headers: bool = False, request_timeout: int | None = None, request_retries: int | None = None, output_format: weaver.formats.AnyOutputFormat | None = None) OperationResult[source]

Obtain the information from a Job.

The Job must be in the expected status to retrieve relevant information.

Parameters:
  • job_reference – Either the full Job status URL or only its UUID.

  • url – Instance URL if not already provided during client creation.

  • auth – Instance authentication handler if not already created during client creation. Should perform required adjustments to request to allow access control of protected contents.

  • headers – Additional headers to employ when sending request. Note that this can break functionalities if expected headers are overridden. Use with care.

  • with_links – Indicate if links section should be preserved in returned result body.

  • with_headers – Indicate if response headers should be returned in result output.

  • request_timeout – Maximum timout duration (seconds) to wait for a response when performing HTTP requests.

  • request_retries – Amount of attempt to retry HTTP requests in case of failure.

  • output_format – Select an alternate output representation of the result body contents.

Returns:

Retrieved information from the Job.

logs(**kwargs)[source]
exceptions(**kwargs)[source]
statistics(**kwargs)[source]
monitor(job_reference: str, timeout: int | None = None, interval: int | None = None, wait_for_status: str = Status.SUCCEEDED, url: str | None = None, auth: AuthHandler | None = None, headers: weaver.typedefs.AnyHeadersContainer | None = None, with_links: bool = True, with_headers: bool = False, request_timeout: int | None = None, request_retries: int | None = None, output_format: weaver.formats.AnyOutputFormat | None = None) OperationResult[source]

Monitor the execution of a Job until completion.

Parameters:
  • job_reference – Either the full Job status URL or only its UUID.

  • timeout – timeout (seconds) of maximum wait time for monitoring if completion is not reached.

  • interval – wait interval (seconds) between polling monitor requests.

  • wait_for_status – monitor until the requested status is reached (default: job failed or succeeded).

  • url – Instance URL if not already provided during client creation.

  • auth – Instance authentication handler if not already created during client creation. Should perform required adjustments to request to allow access control of protected contents.

  • headers – Additional headers to employ when sending request. Note that this can break functionalities if expected headers are overridden. Use with care.

  • with_links – Indicate if links section should be preserved in returned result body.

  • with_headers – Indicate if response headers should be returned in result output.

  • request_timeout – Maximum timout duration (seconds) to wait for a response when performing HTTP requests.

  • request_retries – Amount of attempt to retry HTTP requests in case of failure.

  • output_format – Select an alternate output representation of the result body contents.

Returns:

Result of the successful or failed job, or timeout of monitoring process.

_download_references(outputs: weaver.typedefs.ExecutionResults, out_links: weaver.typedefs.AnyHeadersContainer, out_dir: str, job_id: str, auth: AuthHandler | None = None) weaver.typedefs.ExecutionResults[source]

Download file references from results response contents and link headers.

Downloaded files extend the results contents with path and source fields to indicate where the retrieved files have been saved and where they came from. When files are found by HTTP header links, they are added to the output contents to generate a combined representation in the operation result.

results(job_reference: str, out_dir: str | None = None, download: bool = False, url: str | None = None, auth: AuthHandler | None = None, headers: weaver.typedefs.AnyHeadersContainer | None = None, with_links: bool = True, with_headers: bool = False, request_timeout: int | None = None, request_retries: int | None = None, output_format: weaver.formats.AnyOutputFormat | None = None) OperationResult[source]

Obtain the results of a successful Job execution.

Parameters:
  • job_reference – Either the full Job status URL or only its UUID.

  • out_dir – Output directory where to store downloaded files if requested (default: CURDIR/JobID/<outputs>).

  • download – Download any file reference found within results (CAUTION: could transfer lots of data!).

  • url – Instance URL if not already provided during client creation.

  • auth – Instance authentication handler if not already created during client creation. Should perform required adjustments to request to allow access control of protected contents.

  • headers – Additional headers to employ when sending request. Note that this can break functionalities if expected headers are overridden. Use with care.

  • with_links – Indicate if links section should be preserved in returned result body.

  • with_headers – Indicate if response headers should be returned in result output.

  • request_timeout – Maximum timout duration (seconds) to wait for a response when performing HTTP requests.

  • request_retries – Amount of attempt to retry HTTP requests in case of failure.

  • output_format – Select an alternate output representation of the result body contents.

Returns:

Result details and local paths if downloaded.

dismiss(job_reference: str, url: str | None = None, auth: AuthHandler | None = None, headers: weaver.typedefs.AnyHeadersContainer | None = None, with_links: bool = True, with_headers: bool = False, request_timeout: int | None = None, request_retries: int | None = None, output_format: weaver.formats.AnyOutputFormat | None = None) OperationResult[source]

Dismiss pending or running Job, or clear result artifacts from a completed Job.

Parameters:
  • job_reference – Either the full Job status URL or only its UUID.

  • url – Instance URL if not already provided during client creation.

  • auth – Instance authentication handler if not already created during client creation. Should perform required adjustments to request to allow access control of protected contents.

  • headers – Additional headers to employ when sending request. Note that this can break functionalities if expected headers are overridden. Use with care.

  • with_links – Indicate if links section should be preserved in returned result body.

  • with_headers – Indicate if response headers should be returned in result output.

  • request_timeout – Maximum timout duration (seconds) to wait for a response when performing HTTP requests.

  • request_retries – Amount of attempt to retry HTTP requests in case of failure.

  • output_format – Select an alternate output representation of the result body contents.

Returns:

Obtained result from the operation.

weaver.cli.setup_logger_from_options(logger: logging.Logger, args: argparse.Namespace) None[source]

Uses argument parser options to setup logging level from specified flags.

Setup both the specific CLI logger that is provided and the top-level package logger.

weaver.cli.make_logging_options(parser: argparse.ArgumentParser) None[source]

Defines argument parser options for logging operations.

weaver.cli.add_url_param(parser: argparse.ArgumentParser, required: bool = True) None[source]
weaver.cli.add_shared_options(parser: argparse.ArgumentParser) None[source]
weaver.cli.add_listing_options(parser: argparse.ArgumentParser, item: str) None[source]
weaver.cli.parse_auth(kwargs: Dict[str, Type[AuthHandler] | str | None]) AuthHandler | None[source]

Parses arguments that can define an authentication handler and remove them from dictionary for following calls.

weaver.cli.add_provider_param(parser: argparse.ArgumentParser, description: str | None = None, required: bool = True) None[source]
weaver.cli.add_process_param(parser: argparse.ArgumentParser, description: str | None = None, required: bool = True) None[source]
weaver.cli.add_job_ref_param(parser: argparse.ArgumentParser) None[source]
weaver.cli.add_timeout_param(parser: argparse.ArgumentParser) None[source]
class weaver.cli.SubscriberAction(option_strings: List[str], dest: str = None, **kwargs: Any)[source]

Action that will validate that the input argument references a valid subscriber argument.

If valid, the returned value will be an updated subscriber definition. All arguments using action=SubscriberType should include a dest="<holder>.<subscriber>" parameter that will map the subscriber value under a dictionary holder that will be passed to the argparse.Namespace.

validate(option: str, value: Any) None[source]
weaver.cli.add_subscribers_params(parser: argparse.ArgumentParser) None[source]
weaver.cli.set_parser_sections(parser: argparse.ArgumentParser) None[source]
class weaver.cli.ValidateAuthHandlerAction(option_strings, dest, nargs=None, const=None, default=None, type=None, choices=None, required=False, help=None, metavar=None)[source]

Action that will validate that the input argument references an authentication handler that can be resolved.

class weaver.cli.ValidateMethodAction(option_strings, dest, nargs=None, const=None, default=None, type=None, choices=None, required=False, help=None, metavar=None)[source]

Action that will validate that the input argument one of the accepted HTTP methods.

methods = ['GET', 'HEAD', 'POST', 'PUT', 'DELETE'][source]
class weaver.cli.ValidateHeaderAction(option_strings, dest, nargs=None, const=None, default=None, type=None, choices=None, required=False, help=None, metavar=None)[source]

Action that will validate that the input argument is a correctly formed HTTP header name.

Each header should be provided as a separate option using format:

Header-Name: Header-Value
class weaver.cli.ValidateNonZeroPositiveNumberAction(option_strings, dest, nargs=None, const=None, default=None, type=None, choices=None, required=False, help=None, metavar=None)[source]

Action that will validate that the input argument is a positive number greater than zero.

class weaver.cli.ParagraphFormatter(prog, indent_increment=2, max_help_position=24, width=None)[source]

Formatter for generating usage messages and argument help strings.

Only the name of this class is considered a public API. All the methods provided by the class are considered an implementation detail.

property help_mode[source]
format_help() str[source]
_format_usage(*args, **kwargs)[source]
_format_action(action: argparse.Action) str[source]

Override the returned help message with available options and shortcuts for description paragraphs.

This ensures that paragraphs defined the argument’s help remain separated and properly formatted.

class weaver.cli.SubArgumentParserFixedMutexGroups(prog=None, usage=None, description=None, epilog=None, parents=[], formatter_class=HelpFormatter, prefix_chars='-', fromfile_prefix_chars=None, argument_default=None, conflict_handler='error', add_help=True, allow_abbrev=True, exit_on_error=True)[source]

Patch incorrectly handled mutually exclusive groups sections in subparsers.

_add_container_actions(container)[source]
class weaver.cli.ArgumentParserFixedRequiredArgs(prog=None, usage=None, description=None, epilog=None, parents=[], formatter_class=HelpFormatter, prefix_chars='-', fromfile_prefix_chars=None, argument_default=None, conflict_handler='error', add_help=True, allow_abbrev=True, exit_on_error=True)[source]

Override action grouping under ‘required’ section to consider explicit flag even if action has option prefix.

Default behaviour places option prefixed (-, --) arguments into optionals even if required is defined. Help string correctly considers this flag and doesn’t place those arguments in brackets ([--<optional-arg>]).

_add_action(action)[source]
class weaver.cli.WeaverSubParserAction(option_strings, prog, parser_class, dest=SUPPRESS, required=False, help=None, metavar=None)[source]

Parser that provides fixes for proper representation of Weaver CLI operations.

add_parser(*args, **kwargs)[source]
class weaver.cli.WeaverArgumentParser(*args: Any, **kwargs: Any)[source]

Parser that provides fixes for proper representation of Weaver CLI arguments.

property help_mode[source]

Option enabled only during help formatting to generate different conditional evaluations.

add_subparsers(*args, **kwargs)[source]
add_help_conditional(container: argparse._ActionsContainer, help_required: bool = True, use_required: bool = False) argparse._ActionsContainer[source]
add_formatter(formatter: Callable[[str], str]) None[source]

Define a POST-help formatter.

_get_formatter() argparse.HelpFormatter[source]
format_help() str[source]
add_rule(rule: Callable[[argparse.Namespace], bool | None], failure: str) None[source]
parse_known_args(args: Sequence[str] | None = None, namespace: argparse.Namespace | None = None) Tuple[argparse.Namespace, Sequence[str]][source]

Parse argument actions with handling of additional rules if any were defined.

Note

It is important to derive and call parse_known_args() rather than parse_args() to ensure nested subparsers rules validation can also be invoked.

weaver.cli.make_parser() argparse.ArgumentParser[source]

Generate the CLI parser.

Note

Instead of employing argparse.ArgumentParser instances returned by argparse._SubParsersAction.add_parser(), distinct argparse.ArgumentParser instances are created for each operation and then merged back by ourselves as subparsers under the main parser. This provides more flexibility in arguments passed down and resolves, amongst other things, incorrect handling of exclusive argument groups and their grouping under corresponding section titles.

weaver.cli.main(*args: str) int[source]
weaver.compat
Module Contents
class weaver.compat.Version(version: str)[source]

This class abstracts handling of a project’s versions.

A Version instance is comparison aware and can be compared and sorted using the standard Python interfaces.

>>> v1 = Version("1.0a5")
>>> v2 = Version("1.0")
>>> v1
<Version('1.0a5')>
>>> v2
<Version('1.0')>
>>> v1 < v2
True
>>> v1 == v2
False
>>> v1 > v2
False
>>> v1 >= v2
False
>>> v1 <= v2
True

Initialize a Version object.

Parameters:

version – The string representation of a version which will be parsed and normalized before use.

Raises:

InvalidVersion – If the version does not conform to PEP 440 in any way then this exception will be raised.

property version: Tuple[int | str, Ellipsis][source]
property patch[source]
weaver.compat.cache[source]
weaver.config
Module Contents
weaver.config.LOGGER[source]
class weaver.config.WeaverConfiguration[source]

Configuration mode for which the Weaver instance should operate to provide different functionalities.

DEFAULT = 'DEFAULT'[source]
ADES = 'ADES'[source]
EMS = 'EMS'[source]
HYBRID = 'HYBRID'[source]
class weaver.config.WeaverFeature[source]

Features enabled accordingly to different combinations of WeaverConfiguration modes.

REMOTE[source]
QUOTING[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 | None, 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: pyramid.config.Configurator) None[source]
weaver.datatype

Definitions of types used by tokens.

Module Contents
weaver.datatype.AnyParams[source]
weaver.datatype.LOGGER[source]
class weaver.datatype.DictBase[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.

classmethod properties(fget: bool = True, fset: bool = True) Iterator[str][source]

Get names of properties stored in the object, optionally filtered by read-only or write-only conditions.

dict() AnyParams[source]

Generate a dictionary representation of the object, but with inplace resolution of attributes as applicable.

class weaver.datatype.AutoBase[source]

Base that automatically converts literal class members to properties also accessible by dictionary keys.

class Data(AutoBase):
    field = 1
    other = None

d = Data()
d.other         # returns None
d.other = 2     # other is modified
d.other         # returns 2
dict(d)         # returns {'field': 1, 'other': 2}
d.field         # returns 1
d["field"]      # also 1 !

Initialize self. See help(type(self)) for accurate signature.

class weaver.datatype.Base[source]

Base interface for all data-types.

Initialize self. See help(type(self)) for accurate signature.

abstract property id[source]
property uuid: uuid.UUID[source]
abstract json() 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() AnyParams[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.LocalizedDateTimeProperty(fget: Callable[[Any], datetime.datetime | None] = None, fset: Callable[[Any, datetime.datetime | str], None] = None, fdel: Callable[[Any], None] = None, doc: str = None, default_now: bool = False)[source]

Property that ensures date-time localization is applied on the stored/retrieved value as required.

Initialize self. See help(type(self)) for accurate signature.

class weaver.datatype.Service(*args: Any, **kwargs: Any)[source]

Dictionary that contains OWS services.

It always has url key.

Initialize self. See help(type(self)) for accurate signature.

property id[source]
property url[source]

Service URL.

property name[source]

Service name.

property type[source]

Service type.

property public[source]

Flag if service has public access.

property auth[source]

Authentication method: public, token, cert.

json() 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() AnyParams[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.

wps(container: weaver.typedefs.AnySettingsContainer = None, **kwargs: Any) owslib.wps.WebProcessingService[source]

Obtain the remote WPS service definition and metadata.

Stores the reference locally to avoid re-fetching it needlessly for future reference.

Obtains the links relevant to the service Provider.

Parameters:
  • container – object that helps retrieve instance details, namely the host URL.

  • fetch – whether to attempt retrieving more precise details from the remote provider.

  • self_link – name of a section that represents the current link that will be returned.

metadata(container: weaver.typedefs.AnySettingsContainer) List[weaver.typedefs.Metadata][source]

Obtains the metadata relevant to the service provider.

keywords(container: weaver.typedefs.AnySettingsContainer = None) List[str][source]

Obtains the keywords relevant to the service provider.

summary(container: weaver.typedefs.AnySettingsContainer, fetch: bool = True, ignore: bool = False) weaver.typedefs.JSON | None[source]

Obtain the summary information from the provider service.

When metadata fetching is disabled, the generated summary will contain only information available locally.

Parameters:
  • container – Employed to retrieve application settings.

  • fetch – Indicates whether metadata should be fetched from remote.

  • ignore – Indicates if failing metadata retrieval/parsing should be silently discarded or raised.

Returns:

generated summary information.

Raises:
  • ServiceParsingError – If the target service provider is not reachable, content is not parsable or any other error related to validating the service that needs to be understood for summary creation.

  • colander.Invalid – If the generated response format is not valid according to schema definition.

processes(container: weaver.typedefs.AnySettingsContainer, ignore: bool = False) List[Process] | None[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.

Parameters:
  • container – Employed to retrieve application settings.

  • ignore – Indicates if failing service retrieval/parsing should be silently discarded or raised.

Raises:

ServiceParsingError – If parsing failed and was NOT requested to be ignored.

Returns:

If parsing was successful, list of converted remote service processes. If parsing failed and was requested to be ignored, returns None to distinguish from empty process list.

check_accessible(settings: weaver.typedefs.AnySettingsContainer, ignore: bool = True) bool[source]

Verify if the service URL is accessible.

class weaver.datatype.Job(*args: Any, **kwargs: Any)[source]

Dictionary that contains Job details for local Process or remote OWS execution.

It always has id and task_id keys.

Initialize self. See help(type(self)) for accurate signature.

property id: uuid.UUID[source]

Job UUID to retrieve the details from storage.

property task_id: weaver.typedefs.AnyUUID | None[source]

Reference Task UUID attributed by the Celery worker that monitors and executes this job.

property wps_id: uuid.UUID | None[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: str | None[source]

Service identifier of the corresponding remote process.

See also

property process: str | None[source]

Process identifier of the corresponding remote process.

See also

  • Process.id

property type: str[source]

Obtain the type of the element associated to the creation of this job.

property user_id: str | None[source]
property status: weaver.status.Status[source]
property status_message: str[source]
property status_location: str | None[source]
property subscribers: weaver.typedefs.ExecutionSubscribers | None[source]
property accept_language: str | None[source]
property execute_async: bool[source]
property execute_sync: bool[source]
property execution_mode: weaver.execute.AnyExecuteMode[source]
property execution_response: weaver.execute.AnyExecuteResponse[source]
property is_local: bool[source]
property is_workflow: bool[source]
property is_finished: bool[source]
property duration: datetime.timedelta | None[source]
property duration_str: str[source]
property progress: weaver.typedefs.Number[source]
property statistics: weaver.typedefs.Statistics | None[source]

Collected statistics about used memory and processing units if available.

property access: weaver.visibility.Visibility[source]

Job visibility access from execution.

property context: str | None[source]

Job outputs context.

property request: str | None[source]

XML request for WPS execution submission as string (binary).

property response: str | None[source]

XML status response from WPS execution submission as string (binary).

inputs[source]
outputs[source]
created[source]
started[source]
finished[source]
updated[source]
results[source]
exceptions[source]
logs[source]
tags[source]
static _get_message(message: str, size_limit: int | None = None) str[source]
_get_log_msg(msg: str | None = None, status: weaver.status.AnyStatusType | None = None, progress: weaver.typedefs.Number | None = None, size_limit: int | None = None) str[source]
static _get_err_msg(error: owslib.wps.WPSException, size_limit: int | None = None) str[source]
save_log(errors: str | Exception | owslib.wps.WPSException | List[owslib.wps.WPSException] | None = None, logger: logging.Logger | None = None, message: str | None = None, level: weaver.typedefs.AnyLogLevel = INFO, status: weaver.status.AnyStatusType | None = None, progress: weaver.typedefs.Number | None = None, size_limit: int | None = 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 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 Job.progress value if not specified.

  • size_limit – Log message entries that individually exceed the limit will be clipped with a generic message. The parameter is provided for convenience, but take note that setting a too large value could cause the complete Job to fail saving to the database if its total size exceeds the document limit.

Note

The job object is updated with the log but still requires to be pushed to database to actually persist it.

_get_inputs() weaver.typedefs.ExecutionInputs | None[source]
_set_inputs(inputs: weaver.typedefs.ExecutionInputs | None) None[source]
_get_outputs() weaver.typedefs.ExecutionOutputs | None[source]
_set_outputs(outputs: weaver.typedefs.ExecutionOutputs | None) None[source]
mark_finished() None[source]
_get_updated() datetime.datetime[source]
_get_results() List[Dict[str, weaver.typedefs.JSON] | None][source]
_set_results(results: List[Dict[str, weaver.typedefs.JSON] | None]) None[source]
_get_exceptions() List[str | Dict[str, str]][source]
_set_exceptions(exceptions: List[str | Dict[str, str]]) None[source]
_get_logs() List[str][source]
_set_logs(logs: List[str]) None[source]
_get_tags() List[str | None][source]
_set_tags(tags: List[str | None]) None[source]
_job_url(base_url: str) str[source]
job_url(container: weaver.typedefs.AnySettingsContainer | None = None, extra_path: str | None = None) str[source]
status_url(container: weaver.typedefs.AnySettingsContainer | None = None) str[source]
logs_url(container: weaver.typedefs.AnySettingsContainer | None = None) str[source]
exceptions_url(container: weaver.typedefs.AnySettingsContainer | None = None) str[source]
inputs_url(container: weaver.typedefs.AnySettingsContainer | None = None) str[source]
outputs_url(container: weaver.typedefs.AnySettingsContainer | None = None) str[source]
results_url(container: weaver.typedefs.AnySettingsContainer | None = None) str[source]

Obtains the JSON links section of the response body for a Job.

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(container: weaver.typedefs.AnySettingsContainer | None = None) weaver.typedefs.JSON[source]

Obtains the JSON data representation for Job 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() AnyParams[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.AuthenticationTypes[source]

Generic enumeration.

Derive from this class to define new enumerations.

DOCKER = 'docker'[source]
VAULT = 'vault'[source]
class weaver.datatype.Authentication(auth_scheme: str, auth_token: str | None = None, auth_username: str | None = None, auth_password: str | None = None, auth_link: str | None = None, **kwargs: Any)[source]

Authentication details to store details required for process operations.

Initialize self. See help(type(self)) for accurate signature.

abstract property type: AuthenticationTypes[source]
property id: uuid.UUID[source]
property token: str[source]
property scheme: str[source]
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() AnyParams[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.

classmethod from_credentials(username: str, password: str, **params: Any) AnyAuthentication[source]
classmethod from_params(**params: Any) AnyAuthentication[source]

Obtains the specialized Authentication using loaded parameters from params().

class weaver.datatype.DockerAuthentication(auth_link: str, auth_scheme: str = 'Basic', auth_token: str | None = None, **kwargs: Any)[source]

Authentication associated to a Docker image to retrieve from a private registry given by the reference link.

Initialize the authentication reference for pulling a Docker image from a protected registry.

Parameters:
  • auth_link – Fully qualified Docker registry image link ({registry-url}/{image}:{label}).

  • auth_scheme – Authentication scheme (Basic, Bearer, etc.) if required.

  • kwargs – Additional parameters including authentication token, username/password credentials according to specified scheme, and other definitions to load contents already parsed from database.

property credentials: weaver.typedefs.JSON[source]

Generates the credentials to submit the login operation based on the authentication token and scheme.

property image: str[source]

Obtains the image portion of the reference without repository prefix.

property registry: str[source]

Obtains the registry entry that must be used for docker login {registry}.

property reference: str[source]

Obtains the full reference required when doing Docker operations such as docker pull {reference}.

property repository: str[source]

Obtains the full Docker repository reference without any tag.

property tag: str | None[source]

Obtain the requested tag from the Docker reference.

DOCKER_REGISTRY_DEFAULT_DOMAIN = 'index.docker.io'[source]
DOCKER_REGISTRY_DEFAULT_URI[source]
type[source]
docker[source]
params() AnyParams[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.VaultFile(file_name: str = '', file_format: str | None = None, file_secret: str | None = None, auth_token: str | None = None, **kwargs: Any)[source]

Dictionary that contains Vault file and its authentication information.

Initialize self. See help(type(self)) for accurate signature.

property secret: bytes[source]

Secret associated to this Vault file to hash contents back and forth.

property id: uuid.UUID[source]

Vault file UUID to retrieve the details from storage.

property name: str[source]

Name to retrieve the file.

property format: str | None[source]

Format Media-Type of the file.

property href: str[source]

Obtain the vault input reference corresponding to the file.

This corresponds to the href value to be provided when submitting an input that should be updated using the vault file of specified UUID and using the respective authorization token in X-Auth-Vault header.

type[source]
bytes = 32[source]
classmethod authorized(file: VaultFile | None, token: str | None) bool[source]

Determine whether the file access is authorized.

This method should be employed to validate access and reduce impact of timing attack analysis.

encrypt(file: IO[bytes | str]) io.BytesIO[source]

Encrypt file data using a secret to avoid plain text contents during temporary Vault storage.

Note

This is not intended to be a strong security countermeasure as contents can still be decrypted at any time if provided with the right secret. This is only to slightly obfuscate the contents while it transits between storage phases until destruction by the consuming process.

decrypt(file: IO[bytes | str]) io.BytesIO[source]

Decrypt file contents using secret.

json() 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() AnyParams[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: Any, **kwargs: Any)[source]

Dictionary that contains a process definition for db storage.

It always has identifier (or id alias) and a package definition. Parameters can be accessed by key or attribute, and appropriate validators or default values will be applied.

Initialize self. See help(type(self)) for accurate signature.

property latest: bool[source]

Checks if this Process corresponds to the latest revision.

property name: str[source]

Obtain only the Process name portion of the unique identifier.

property tag: str[source]

Full identifier including the version for a unique reference.

property title: str[source]
property keywords: List[str][source]
property metadata: List[weaver.typedefs.Metadata][source]
property version: str | None[source]
property inputs: List[Dict[str, weaver.typedefs.JSON]] | None[source]

Inputs of the process following backward-compatible conversion of stored parameters.

According to OGC-API, maxOccurs and minOccurs representations should be:
  • maxOccurs: int or "unbounded"

  • minOccurs: int

And, mediaType should be in description as:
  • mediaType: string

Note

Because of pre-registered/deployed/retrieved remote processes, inputs are formatted in-line to respect valid OGC-API schema representation and apply any required correction transparently.

property outputs: List[Dict[str, weaver.typedefs.JSON]] | None[source]

Outputs of the process following backward-compatible conversion of stored parameters.

According to OGC-API, mediaType should be in description as:
  • mediaType: string

Note

Because of pre-registered/deployed/retrieved remote processes, inputs are formatted in-line to respect valid OGC-API schema representation and apply any required correction transparently.

property jobControlOptions: List[weaver.execute.AnyExecuteControlOption][source]

Control options that indicate which Job execution modes are supported by the Process.

Note

There are no official mentions about the ordering of jobControlOptions. Nevertheless, it is often expected that the first item can be considered the default mode when none is requested explicitly (at execution time). With the definition of execution mode through the Prefer header, Weaver has the option to decide if it wants to honor this header, according to available resources and Job duration.

For this reason, async is placed first by default when nothing was defined during deployment, since it is the preferred mode in Weaver. If deployment included items though, they are preserved as is. This allows to re-deploy a Process to a remote non-Weaver ADES preserving the original Process definition.

See also

Discussion about expected ordering of jobControlOptions: https://github.com/opengeospatial/ogcapi-processes/issues/171#issuecomment-836819528

property outputTransmission: List[weaver.execute.AnyExecuteTransmissionMode][source]
property processDescriptionURL: str | None[source]
property processEndpointWPS1: str | None[source]
property executeEndpoint: str | None[source]
property owsContext: weaver.typedefs.JSON | None[source]
property type: weaver.processes.types.AnyProcessType[source]

Type of process amongst weaver.processes.types definitions.

property mutable: bool[source]

Indicates if a process can be modified.

property deployment_profile: str[source]
property package: weaver.typedefs.CWL | None[source]

Package CWL definition as JSON.

property payload: weaver.typedefs.JSON[source]

Deployment specification as JSON.

property estimator: weaver.typedefs.JSON[source]
property visibility: weaver.visibility.Visibility[source]
property auth: AnyAuthentication | None[source]

Authentication token required for operations with the process.

property params_wps: AnyParams[source]

Values applicable to create an instance of pywps.app.Process.

property service: str | None[source]

Name of the parent service provider under which this process resides.

_character_codes = [('$', '$'), ('.', '.')][source]
_get_id() str[source]
_set_id(_id: str) None[source]
classmethod split_version(process_id: str) Tuple[str, str | None][source]

Split the tagged version from the Process identifier considering any required special handling.

Returns:

Process ID (only) and the version if any was available in tagged reference.

_get_desc() str[source]
_set_desc(description: str) None[source]
static _recursive_replace(pkg: weaver.typedefs.JSON, index_from: int, index_to: int) weaver.typedefs.JSON[source]
static _encode(obj: weaver.typedefs.JSON | None) weaver.typedefs.JSON | None[source]
static _decode(obj: weaver.typedefs.JSON | None) weaver.typedefs.JSON | None[source]
params() AnyParams[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.

dict() AnyParams[source]

Generate a dictionary representation of the object, but with inplace resolution of attributes as applicable.

json() weaver.typedefs.JSON[source]

Obtains the JSON serializable complete representation of the process.

Obtains the JSON links section of many response body for the Process.

Parameters:

container – object that helps retrieve instance details, namely the host URL.

href(container: weaver.typedefs.AnySettingsContainer | None = None) str[source]

Obtain the reference URL for this Process.

offering(schema: weaver.processes.constants.ProcessSchemaType = ProcessSchema.OGC, request: weaver.typedefs.AnyRequestType = None) weaver.typedefs.JSON[source]

Obtains the JSON or XML serializable offering/description representation of the Process.

Parameters:
  • request – HTTP request that can provide more details on how to describe the process.

  • schema – One of values defined by sd.ProcessDescriptionSchemaQuery to select which process description representation to generate (see each schema for details).

Note

Property name offering is employed to differentiate from the string process description field. The result of this JSON representation is still the ProcessDescription schema.

summary(revision: bool = False, links: bool = True, container: weaver.typedefs.AnySettingsContainer | None = None) weaver.typedefs.JSON[source]

Obtains the JSON serializable summary representation of the process.

Parameters:
  • revision – Replace the process identifier by the complete tag representation.

  • links – Include process links in summary.

  • container – Application settings or database container to retrieve links and avoid reconnections.

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: Service | None = None, container: weaver.typedefs.AnySettingsContainer | None = None, **kwargs: Any) Process[source]

Converts known process equivalents definitions into the formal datatype employed by Weaver.

xml(request: weaver.typedefs.AnyRequestType) str[source]

Obtain the raw XML representation of the Process using WPS schema.

wps() pywps.Process[source]

Converts this Process to a corresponding format understood by pywps.

class weaver.datatype.PriceMixin[source]

Base interface for all data-types.

Initialize self. See help(type(self)) for accurate signature.

property amount: decimal.Decimal[source]

Amount of the current quote.

property currency: str[source]

Currency of the quote price.

property price: weaver.typedefs.Price[source]
class weaver.datatype.Quote(*args: Any, **kwargs: Any)[source]

Dictionary that contains quote information.

It always has id and process keys.

Initialize the quote.

Note

Although many parameters are required to render the final quote, they are not enforced at creation since the partial quote definition is needed before it can be processed.

property paid: bool[source]
property id: uuid.UUID[source]

Quote ID.

property detail: str | None[source]
property status: weaver.quotation.status.QuoteStatus[source]
property user: str | int | None[source]

User ID requesting the quote.

property process: str[source]

Process ID.

property seconds: int[source]

Estimated time of the process execution in seconds.

property duration: datetime.timedelta[source]

Duration as delta time that can be converted to ISO-8601 format (P[n]Y[n]M[n]DT[n]H[n]M[n]S).

property duration_str: str[source]

Human-readable duration in formatted as hh:mm:ss.

property parameters: weaver.typedefs.QuoteProcessParameters[source]

Process execution parameters for quote.

This should include minimally the inputs and expected outputs, but could be extended as needed with relevant details for quoting algorithm.

property results: weaver.typedefs.QuoteProcessResults[source]

Process execution results following quote estimation.

property outputs: weaver.typedefs.QuoteStepOutputParameters[source]

Quote estimation outputs for a following step quote estimation.

property steps: List[uuid.UUID][source]

Sub-quote IDs if applicable.

expire[source]
created[source]
setdefault(key, default)[source]

Insert key with a value of default if key is not in the dictionary.

Return the value for key if key is in the dictionary, else default.

update(mapping, **__)[source]

D.update([E, ]**F) -> None. Update D from dict/iterable E and F. If E is present and has a .keys() method, then does: for k in E: D[k] = E[k] If E is present and lacks a .keys() method, then does: for k, v in E: D[k] = v In either case, this is followed by: for k in F: D[k] = F[k]

params() AnyParams[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.

partial() weaver.typedefs.JSON[source]

Submitted Quote representation with minimal details until evaluation is completed.

json() weaver.typedefs.JSON[source]

Step Quote with JSON representation.

Note

Does not include derived Quote details if the associated Process is a Workflow.

href(container: weaver.typedefs.AnySettingsContainer | None = None) str[source]

Obtain the reference URL for this Quote.

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[source]

Bill ID.

property user[source]

User ID.

property quote[source]

Quote ID.

property job[source]

Job ID.

property created[source]

Quote creation datetime.

property title[source]

Quote title.

property description[source]

Quote description.

params() AnyParams[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() 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

Errors raised during the Weaver flow.

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.ListingInvalidParameter[source]

Error related to an invalid parameter for listing queries.

Initialize self. See help(type(self)) for accurate signature.

code = 400[source]
exception weaver.exceptions.InvalidIdentifierValue(detail=None, headers=None, comment=None, body_template=None, json_formatter=None, **kw)[source]

Error related to an invalid identifier parameter.

Error indicating that an ID to be employed for following operations is not considered as valid to allow further processing or usage.

Initialize self. See help(type(self)) for accurate signature.

code = 400[source]
locator = 'identifier'[source]
exception weaver.exceptions.MissingIdentifierValue(detail=None, headers=None, comment=None, body_template=None, json_formatter=None, **kw)[source]

Error related to missing identifier parameter.

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(detail: str | None = None, value: Any | None = None, json: weaver.typedefs.JSON | None = None, **kw: Any)[source]

Base exception related to a weaver.datatype.Service.

Initialize self. See help(type(self)) for accurate signature.

locator = 'service'[source]
exception weaver.exceptions.ServiceParsingError(detail=None, headers=None, comment=None, body_template=None, json_formatter=None, **kw)[source]

Error related to parsing issue of the reference service definition (incorrectly formed XML/JSON contents).

Initialize self. See help(type(self)) for accurate signature.

exception weaver.exceptions.ServiceNotAccessible(detail=None, headers=None, comment=None, body_template=None, result=None, **kw)[source]

Error related to forbidden access to a service.

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(detail=None, headers=None, comment=None, body_template=None, json_formatter=None, **kw)[source]

Error related to non-existent service definition.

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(detail=None, headers=None, comment=None, body_template=None, json_formatter=None, **kw)[source]

Error related to a registration issue for a service.

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(detail: str | None = None, value: Any | None = None, json: weaver.typedefs.JSON | None = None, **kw: Any)[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(detail=None, headers=None, comment=None, body_template=None, result=None, **kw)[source]

Error related to forbidden access to a process.

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(detail=None, headers=None, comment=None, body_template=None, json_formatter=None, **kw)[source]

Error related to a non-existent process definition.

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(detail=None, headers=None, comment=None, body_template=None, json_formatter=None, **kw)[source]

Error related to a registration issue for a process.

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(detail=None, headers=None, comment=None, body_template=None, json_formatter=None, **kw)[source]

Error related to an invalid process definition.

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(detail=None, headers=None, comment=None, body_template=None, json_formatter=None, **kw)[source]

Error related to a non-existent job definition.

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.JobGone(detail=None, headers=None, comment=None, body_template=None, json_formatter=None, **kw)[source]

Error related to job resource that is gone.

Error indicating that an existing job, although recognized, was dismissed and underlying resources including results are gone.

Initialize self. See help(type(self)) for accurate signature.

exception weaver.exceptions.JobInvalidParameter(detail=None, headers=None, comment=None, body_template=None, json_formatter=None, **kw)[source]

Error related to an invalid search parameter to filter jobs.

Initialize self. See help(type(self)) for accurate signature.

exception weaver.exceptions.JobStatisticsNotFound(detail=None, headers=None, comment=None, body_template=None, json_formatter=None, **kw)[source]

Error related to statistics not available for a Job.

Statistics could be unavailable due to incomplete execution, failed status, or simply because it is an older result generated before this feature was introduced.

Initialize self. See help(type(self)) for accurate signature.

exception weaver.exceptions.JobRegistrationError(detail=None, headers=None, comment=None, body_template=None, json_formatter=None, **kw)[source]

Error related to a registration issue for a job.

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(detail=None, headers=None, comment=None, body_template=None, json_formatter=None, **kw)[source]

Error related to an update issue for a job.

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(detail=None, headers=None, comment=None, body_template=None, json_formatter=None, **kw)[source]

Error related to an invalid package definition.

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.PackageParsingError(detail=None, headers=None, comment=None, body_template=None, json_formatter=None, **kw)[source]

Error related to parsing of a package definition.

Error indicating that a CWL package could not be properly parsed according to expected structures or unresolved definitions.

Initialize self. See help(type(self)) for accurate signature.

exception weaver.exceptions.PackageRegistrationError(detail=None, headers=None, comment=None, body_template=None, json_formatter=None, **kw)[source]

Error related to a registration issue for a package.

Error indicating that an instance of weaver.processes.wps_package.WpsPackage could not properly be registered for package deployment because of invalid prerequisites.

Initialize self. See help(type(self)) for accurate signature.

exception weaver.exceptions.PackageAuthenticationError(detail=None, headers=None, comment=None, body_template=None, result=None, **kw)[source]

Error related to a runtime failure caused by failing authentication prerequisite.

Error indicating that an instance of weaver.processes.wps_package.WpsPackage could not properly prepare the package because an authentication requirement could not be fulfilled.

Initialize self. See help(type(self)) for accurate signature.

exception weaver.exceptions.PackageExecutionError(detail=None, headers=None, comment=None, body_template=None, json_formatter=None, **kw)[source]

Error related to a runtime issue during package execution.

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(detail=None, headers=None, comment=None, body_template=None, json_formatter=None, **kw)[source]

Error related to a non-existent package definition.

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(detail=None, headers=None, comment=None, body_template=None, json_formatter=None, **kw)[source]

Error related to a non-existent deployment payload definition.

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(detail=None, headers=None, comment=None, body_template=None, json_formatter=None, **kw)[source]

Error related to a non-existent quote definition.

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(detail=None, headers=None, comment=None, body_template=None, json_formatter=None, **kw)[source]

Error related to an invalid registration issue for a quote.

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(detail=None, headers=None, comment=None, body_template=None, json_formatter=None, **kw)[source]

Error related to an invalid quote definition.

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.QuoteEstimationError[source]

Error related to a quote that occurred during its estimation.

Initialize self. See help(type(self)) for accurate signature.

exception weaver.exceptions.QuoteConversionError[source]

Error related to a quote that occurred during its rate conversion.

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(detail=None, headers=None, comment=None, body_template=None, json_formatter=None, **kw)[source]

Error related to a non-existent bill definition.

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(detail=None, headers=None, comment=None, body_template=None, json_formatter=None, **kw)[source]

Error related to a registration issue for a bill.

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(detail=None, headers=None, comment=None, body_template=None, json_formatter=None, **kw)[source]

Error related to an invalid bill definition.

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.

exception weaver.exceptions.VaultFileException[source]

Base exception related to a weaver.datatype.VaultFile.

Initialize self. See help(type(self)) for accurate signature.

locator = 'vault'[source]
exception weaver.exceptions.VaultFileNotFound(detail=None, headers=None, comment=None, body_template=None, json_formatter=None, **kw)[source]

Error related to a non-existent vault file definition.

Error indicating that a vault file could not be read from the storage backend by an instance of weaver.store.VaultStore.

Initialize self. See help(type(self)) for accurate signature.

exception weaver.exceptions.VaultFileRegistrationError(detail=None, headers=None, comment=None, body_template=None, json_formatter=None, **kw)[source]

Error related to a registration issue for a vault file.

Error indicating that a vault file could not be registered in the storage backend by an instance of weaver.store.VaultStore.

Initialize self. See help(type(self)) for accurate signature.

exception weaver.exceptions.VaultFileInstanceError(detail=None, headers=None, comment=None, body_template=None, json_formatter=None, **kw)[source]

Error related to an invalid vault file definition.

Error indicating that a given object doesn’t correspond to an expected instance of weaver.datatype.VaultFile.

Initialize self. See help(type(self)) for accurate signature.

weaver.exceptions.handle_known_exceptions(function: weaver.typedefs.AnyCallableWrapped) 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 weaver.owsexceptions.OWSException are employed since they, themselves, already have base references to pywps.exceptions classes that the service can understand.

Warning

In pywps, HTTPException refers to werkzeug.exceptions.HTTPException while in weaver, it is 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 for logging captured exceptions before re-raise.

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
class weaver.execute.ExecuteMode[source]

Constants container that provides similar functionalities to ExtendedEnum without explicit Enum membership.

AUTO = 'auto'[source]
ASYNC = 'async'[source]
SYNC = 'sync'[source]
class weaver.execute.ExecuteControlOption[source]

Constants container that provides similar functionalities to ExtendedEnum without explicit Enum membership.

ASYNC = 'async-execute'[source]
SYNC = 'sync-execute'[source]
classmethod values() List[AnyExecuteControlOption][source]

Return default control options in specific order according to preferred modes for execution by Weaver.

class weaver.execute.ExecuteResponse[source]

Constants container that provides similar functionalities to ExtendedEnum without explicit Enum membership.

RAW = 'raw'[source]
DOCUMENT = 'document'[source]
class weaver.execute.ExecuteTransmissionMode[source]

Constants container that provides similar functionalities to ExtendedEnum without explicit Enum membership.

VALUE = 'value'[source]
REFERENCE = 'reference'[source]
weaver.execute.AnyExecuteMode[source]
weaver.formats
Module Contents
weaver.formats.FileModeSteamType[source]
weaver.formats.LOGGER[source]
class weaver.formats.AcceptLanguage[source]

Supported languages.

EN_CA = 'en-CA'[source]
FR_CA = 'fr-CA'[source]
EN_US = 'en-US'[source]
classmethod offers() List[str][source]

Languages offered by the application.

class weaver.formats.ContentType[source]

Supported Content-Type values.

Media-Type nomenclature:

<type> "/" [x- | <tree> "."] <subtype> ["+" suffix] *[";" parameter=value]
APP_DIR = 'application/directory'[source]
APP_CWL = 'application/cwl'[source]
APP_CWL_JSON = 'application/cwl+json'[source]
APP_CWL_YAML = 'application/cwl+yaml'[source]
APP_CWL_X = 'application/x-cwl'[source]
APP_FORM = 'application/x-www-form-urlencoded'[source]
APP_GEOJSON = 'application/geo+json'[source]
APP_GZIP = 'application/gzip'[source]
APP_HDF5 = 'application/x-hdf5'[source]
APP_JSON = 'application/json'[source]
APP_OAS_JSON = 'application/vnd.oai.openapi+json; version=3.0'[source]
APP_OGC_PKG_JSON = 'application/ogcapppkg+json'[source]
APP_OGC_PKG_YAML = 'application/ogcapppkg+yaml'[source]
APP_NETCDF = 'application/x-netcdf'[source]
APP_OCTET_STREAM = 'application/octet-stream'[source]
APP_PDF = 'application/pdf'[source]
APP_TAR = 'application/x-tar'[source]
APP_TAR_GZ = 'application/tar+gzip'[source]
APP_VDN_GEOJSON = 'application/vnd.geo+json'[source]
APP_XML = 'application/xml'[source]
APP_YAML = 'application/x-yaml'[source]
APP_ZIP = 'application/zip'[source]
IMAGE_GEOTIFF = 'image/tiff; subtype=geotiff'[source]
IMAGE_OGC_GEOTIFF = 'image/tiff; application=geotiff'[source]
IMAGE_JPEG = 'image/jpeg'[source]
IMAGE_GIF = 'image/gif'[source]
IMAGE_PNG = 'image/png'[source]
IMAGE_TIFF = 'image/tiff'[source]
MULTI_PART_FORM = 'multipart/form-data'[source]
TEXT_ENRICHED = 'text/enriched'[source]
TEXT_HTML = 'text/html'[source]
TEXT_PLAIN = 'text/plain'[source]
TEXT_RICHTEXT = 'text/richtext'[source]
TEXT_XML = 'text/xml'[source]
VIDEO_MPEG = 'video/mpeg'[source]
ANY_JSON[source]
ANY_CWL[source]
ANY_XML[source]
ANY = '*/*'[source]
class weaver.formats.ContentEncoding[source]

Supported Content-Encoding values.

Note

Value binary is kept for convenience and backward compatibility with older definitions. It will default to the same encoding strategy as if base64 was specified explicitly. Value binary is not part of RFC 4648, but remains a common occurrence that dates from when format: binary was the approach employed to represent binary (JSON-schema Draft-04 and prior) instead of what is now recommended using contentEncoding: base64 (JSON-schema Draft-07).

UTF_8 = 'UTF-8'[source]
BINARY = 'binary'[source]
BASE16 = 'base16'[source]
BASE32 = 'base32'[source]
BASE64 = 'base64'[source]
static is_text(encoding: Any) bool[source]

Indicates if the Content-Encoding value can be categorized as textual data.

static is_binary(encoding: Any) bool[source]

Indicates if the Content-Encoding value can be categorized as binary data.

static open_parameters(encoding: Any, mode: FileModeSteamType = 'r') Tuple[FileModeEncoding, typing_extensions.Literal[UTF-8, None]][source]

Obtains relevant mode and encoding parameters for open() using the specified Content-Encoding.

static encode(data: AnyStr, encoding: ContentEncoding = BASE64, binary: typing_extensions.Literal[True] = True) bytes[source]
static encode(data: AnyStr, encoding: ContentEncoding = BASE64, binary: typing_extensions.Literal[False] = False) str
static encode(data: DataStrT, encoding: ContentEncoding = BASE64, binary: typing_extensions.Literal[None] = None) DataStrT

Encodes the data to the requested encoding and convert it to the string-like data type representation.

Parameters:
  • data – Data to encode.

  • encoding – Target encoding method.

  • binary – If unspecified, the string-like type will be the same as the input data. Otherwise, convert the encoded data to str or bytes accordingly.

Returns:

Encoded and converted data.

static decode(data: AnyStr, encoding: ContentEncoding = BASE64, binary: typing_extensions.Literal[True] = True) bytes[source]
static decode(data: AnyStr, encoding: ContentEncoding = BASE64, binary: typing_extensions.Literal[False] = False) str
static decode(data: DataStrT, encoding: ContentEncoding = BASE64, binary: typing_extensions.Literal[None] = None) DataStrT

Decodes the data from the specified encoding and convert it to the string-like data type representation.

Parameters:
  • data – Data to decode.

  • encoding – Expected source encoding.

  • binary – If unspecified, the string-like type will be the same as the input data. Otherwise, convert the decoded data to str or bytes accordingly.

Returns:

Decoded and converted data.

class weaver.formats.OutputFormat[source]

Renderer output formats for CLI, OpenAPI and HTTP response content generation.

JSON[source]
JSON_STR[source]
JSON_RAW[source]
YAML[source]
YML[source]
XML[source]
XML_STR[source]
XML_RAW[source]
TXT[source]
TEXT[source]
classmethod get(format_or_version: str | AnyOutputFormat | weaver.base.PropertyDataTypeT, default: AnyOutputFormat = JSON, allow_version: bool = True) AnyOutputFormat | weaver.base.PropertyDataTypeT[source]

Resolve the applicable output format.

Parameters:
  • format_or_version – Either a WPS version, a known value for a f/format query parameter, or an Accept header that can be mapped to one of the supported output formats.

  • default – Default output format if none could be resolved.

  • allow_version – Enable WPS version specifiers to infer the corresponding output representation.

Returns:

Resolved output format.

classmethod convert(data: weaver.typedefs.JSON, to: AnyOutputFormat | str, item_root: str = 'item') str | weaver.typedefs.JSON[source]

Converts the input data from JSON to another known format.

Parameters:
  • data – Input data to convert. Must be a literal JSON object, not a JSON-like string.

  • to – Target format representation. If the output format is not JSON, it is ALWAYS converted to the formatted string of the requested format to ensure the contents are properly represented as intended. In the case of JSON as target format or unknown format, the original object is returned directly.

  • item_root – When using XML representations, defines the top-most item name. Unused for other representations.

Returns:

Formatted output.

class weaver.formats.SchemaRole[source]

Constants container that provides similar functionalities to ExtendedEnum without explicit Enum membership.

JSON_SCHEMA = 'https://www.w3.org/2019/wot/json-schema'[source]
weaver.formats._CONTENT_TYPE_EXTENSION_OVERRIDES[source]
weaver.formats._CONTENT_TYPE_EXCLUDE[source]
weaver.formats._EXTENSION_CONTENT_TYPES_OVERRIDES[source]
weaver.formats._CONTENT_TYPE_EXTENSION_MAPPING: Dict[str, str][source]
weaver.formats._CONTENT_TYPE_FORMAT_MAPPING: Dict[str, pywps.inout.formats.Format][source]
weaver.formats._CONTENT_TYPE_EXT_PATTERN[source]
weaver.formats._CONTENT_TYPE_LOCALS_MISSING[source]
weaver.formats._CONTENT_TYPE_LOCALS_MISSING[source]
weaver.formats._EXTENSION_CONTENT_TYPES_MAPPING[source]
weaver.formats._CONTENT_TYPE_CHAR_TYPES = ['application', 'multipart', 'text'][source]
weaver.formats._CONTENT_TYPE_SYNONYM_MAPPING[source]
weaver.formats.IANA_NAMESPACE = 'iana'[source]
weaver.formats.IANA_NAMESPACE_URL = 'https://www.iana.org/assignments/media-types/'[source]
weaver.formats.IANA_NAMESPACE_DEFINITION[source]
weaver.formats.IANA_KNOWN_MEDIA_TYPES[source]
weaver.formats.IANA_MAPPING[source]
weaver.formats.EDAM_NAMESPACE = 'edam'[source]
weaver.formats.EDAM_NAMESPACE_URL = 'http://edamontology.org/'[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.OPENGIS_NAMESPACE = 'opengis'[source]
weaver.formats.OPENGIS_NAMESPACE_URL = 'http://www.opengis.net/'[source]
weaver.formats.OPENGIS_NAMESPACE_DEFINITION[source]
weaver.formats.OPENGIS_MAPPING[source]
weaver.formats.OGC_NAMESPACE = 'ogc'[source]
weaver.formats.OGC_NAMESPACE_URL[source]
weaver.formats.OGC_NAMESPACE_DEFINITION[source]
weaver.formats.OGC_MAPPING[source]
weaver.formats.FORMAT_NAMESPACE_MAPPINGS[source]
weaver.formats.FORMAT_NAMESPACE_DEFINITIONS[source]
weaver.formats.FORMAT_NAMESPACE_PREFIXES[source]
weaver.formats.FORMAT_NAMESPACES[source]
weaver.formats.get_allowed_extensions() List[str][source]

Obtain the complete list of extensions that are permitted for processing by the application.

Note

This is employed for security reasons. Files can still be specified with another allowed extension, but it will not automatically inherit properties applicable to scripts and executables. If a specific file type is refused due to its extension, a PR can be submitted to add it explicitly.

weaver.formats.get_format(media_type: str, default: str | None = None) pywps.inout.formats.Format | None[source]

Obtains a Format with predefined extension and encoding details from known media-types.

weaver.formats.get_extension(media_type: str, dot: bool = True) str[source]

Retrieves the extension corresponding to media_type if explicitly defined, or by parsing it.

weaver.formats.get_content_type(extension: str, charset: str | None = None, default: str | None = None) str | None[source]

Retrieves the Content-Type corresponding to the specified extension if it can be matched.

Parameters:
  • extension – Extension for which to attempt finding a known Content-Type.

  • charset – Charset to apply to the Content-Type as needed if extension was matched.

  • default – Default Content-Type to return if no extension is matched.

Returns:

Matched or default Content-Type.

weaver.formats.add_content_type_charset(content_type: str | ContentType, charset: str | None) str[source]

Apply the specific charset to the content-type with some validation in case of conflicting definitions.

Parameters:
  • content_type – Desired Content-Type.

  • charset – Desired charset parameter.

Returns:

updated content-type with charset.

weaver.formats.get_cwl_file_format(media_type: str, make_reference: bool = False, must_exist: bool = True, allow_synonym: bool = True) Tuple[weaver.typedefs.JSON | None, str | None] | str | None[source]

Obtains the extended schema reference from the media-type identifier.

Obtains the corresponding IANA/EDAM/etc. format value to be applied under a CWL I/O File from the media_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 media-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 no 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:
  • media_type – Some reference, namespace’d or literal (possibly extended) media-type string.

  • make_reference – Construct the full URL reference to the resolved media-type. Otherwise, return tuple details.

  • must_exist – Return result only if it can be resolved to an official media-type (or synonym if enabled), otherwise None. Non-official media-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 media-type to an official media-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 media-type is employed directly as result.

Returns:

Resolved media-type format for CWL usage, accordingly to specified arguments (see description details).

weaver.formats.map_cwl_media_type(cwl_format: str | None) str | None[source]

Obtains the Media-Type that corresponds to the specified CWL format.

Parameters:

cwl_format – Long form URL or namespaced variant of a CWL format referring to an ontology Media-Type.

Returns:

Resolved Media-Type.

weaver.formats.clean_media_type_format(media_type: str, suffix_subtype: bool = False, strip_parameters: bool = False) str | None[source]

Obtains a generic media-type identifier by cleaning up any additional parameters.

Removes any additional namespace key or URL from media_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.

Removes any leading temporary local file prefix inserted by CWL when resolving namespace mapping. This transforms file:///tmp/dir/path/package#application/json to plain application/json.

According to provided arguments, it also cleans up additional parameters or extracts sub-type suffixes.

Parameters:
  • media_type – Media-Type, full URL to media-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 media-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.formats.guess_target_format(request: weaver.typedefs.AnyRequestType, default: ContentType | str | None = ContentType.APP_JSON) ContentType[source]

Guess the best applicable response Content-Type header from the request.

Considers the request Accept header, format query and alternatively f query to parse possible formats. Full Media-Type are expected in the header. Query parameters can use both the full Media-Type, or only the sub-type (i.e.: JSON, XML, etc.), with case-insensitive names.

Defaults to ContentType.APP_JSON if none was specified as default explicitly and that no Accept` header or ``format/f queries were provided. Otherwise, applies the specified default format specifiers were not provided in the request.

Applies some specific logic to handle automatically added Accept headers by many browsers such that sending requests to the API using them will not automatically default back to XML or similar HTML representations. If browsers are used to send requests, but that format/f queries are used directly in the URL, those will be applied since this is a very intuitive (and easier) approach to request different formats when using browsers.

When User-Agent clients are identified as another source, such as sending requests from a server or from code, both headers and query parameters are applied directly without question.

Returns:

Matched media-type or default.

weaver.formats.json_default_handler(obj: Any) weaver.typedefs.JSON | str | None[source]
weaver.formats.repr_json(data: Any, force_string: bool = True, ensure_ascii: bool = False, indent: int | None = 2, **kwargs: Any) weaver.typedefs.JSON | str | None[source]

Ensure that the input data can be serialized as JSON to return it formatted representation as such.

If formatting as JSON fails, returns the data as string representation or None accordingly.

weaver.formats.AnyOutputFormat[source]
weaver.notify
Module Contents
weaver.notify.LOGGER[source]
weaver.notify.resolve_email_template(job: weaver.datatype.Job, settings: weaver.typedefs.SettingsType) mako.template.Template[source]

Finds the most appropriate Mako Template email notification file based on configuration and Job context.

The example template is used by default ONLY if the template directory was not overridden. If overridden, failing to match any of the template file locations will raise to report the issue instead of silently using the default.

Raises:

IOError – If the template directory was configured explicitly, but cannot be resolved, or if any of the possible combinations of template file names cannot be resolved under that directory.

Returns:

Matched template instance based on resolution order as described in the documentation.

weaver.notify.notify_job_email(job: weaver.datatype.Job, to_email_recipient: str, container: weaver.typedefs.AnySettingsContainer) None[source]

Send email notification of a Job status.

weaver.notify.get_crypto_key(settings: weaver.typedefs.SettingsType, salt: bytes, rounds: int) bytes[source]

Get the cryptographic key used for encoding and decoding the email.

weaver.notify.encrypt_email(email: str, settings: weaver.typedefs.SettingsType) str[source]
weaver.notify.decrypt_email(email: str, settings: weaver.typedefs.SettingsType) str[source]
weaver.notify.map_job_subscribers(job_body: weaver.typedefs.JSON, settings: weaver.typedefs.SettingsType) weaver.typedefs.ExecutionSubscribers | None[source]

Converts the Job subscribers definition submitted at execution into a mapping for later reference.

The returned contents must be sorted in the relevant Job object. For backward compatibility, notification_email directly provided at the root will be used if corresponding definitions were not provided for the corresponding subscriber email fields.

weaver.notify.send_job_notification_email(job: weaver.datatype.Job, task_logger: logging.Logger, settings: weaver.typedefs.SettingsType) None[source]

Sends a notification email about the execution status for the subscriber if requested during Job submission.

weaver.notify.send_job_callback_request(job: weaver.datatype.Job, task_logger: logging.Logger, settings: weaver.typedefs.SettingsType) None[source]

Send a callback request about the execution status for the subscriber if requested at Job execution.

weaver.notify.notify_job_subscribers(job: weaver.datatype.Job, task_logger: logging.Logger, settings: weaver.typedefs.SettingsType) None[source]

Send notifications to all requested Job subscribers according to its current status.

All notification operations must be implemented as non-raising. In case of error, the Job logs will be updated with relevant error details and resume execution.

weaver.owsexceptions

OWSExceptions definitions.

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 weaver.exceptions.WeaverException) also employ specific OWSExceptions definitions to provide specific error details.

Module Contents
exception weaver.owsexceptions.OWSException(detail: str | None = None, value: Any | None = None, json: weaver.typedefs.JSON | None = None, **kw: Any)[source]

Base OWS Exception definition.

Initialize self. See help(type(self)) for accurate signature.

property wsgi_response[source]
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(environ)[source]
exception weaver.owsexceptions.OWSAccessForbidden(*args, **kwargs)[source]

Base OWS Exception definition.

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]

Base OWS Exception definition.

Initialize self. See help(type(self)) for accurate signature.

code = 'NotFound'[source]
locator = ''[source]
explanation = 'Resource does not exist.'[source]
exception weaver.owsexceptions.OWSGone(*args, **kwargs)[source]

Base OWS Exception definition.

Initialize self. See help(type(self)) for accurate signature.

code = 'ResourceGone'[source]
locator = ''[source]
explanation = 'Resource is gone.'[source]
exception weaver.owsexceptions.OWSNotAcceptable(*args, **kwargs)[source]

Base OWS Exception definition.

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]

Base OWS Exception definition.

Initialize self. See help(type(self)) for accurate signature.

code = 'NotImplemented'[source]
locator = ''[source]
description = 'Operation is not implemented.'[source]
weaver.sort
Module Contents
class weaver.sort.Sort[source]

Constants container that provides similar functionalities to ExtendedEnum without explicit Enum membership.

CREATED = 'created'[source]
FINISHED = 'finished'[source]
STATUS = 'status'[source]
PROCESS = 'process'[source]
SERVICE = 'service'[source]
USER = 'user'[source]
QUOTE = 'quote'[source]
PRICE = 'price'[source]
ID = 'id'[source]
ID_LONG = 'identifier'[source]
VERSION = 'version'[source]
class weaver.sort.SortMethods[source]

Constants container that provides similar functionalities to ExtendedEnum without explicit Enum membership.

PROCESS[source]
JOB[source]
QUOTE[source]
BILL[source]
weaver.sort.AnySortType[source]
weaver.status
Module Contents
class weaver.status.StatusCompliant[source]

Utility enum.Enum methods.

Create an extended enum with these utilities as follows.

class CustomEnum(ExtendedEnum):
    ItemA = "A"
    ItemB = "B"

Warning

Must not define any enum value here to allow inheritance by subclasses.

OGC = 'OGC'[source]
PYWPS = 'PYWPS'[source]
OWSLIB = 'OWSLIB'[source]
class weaver.status.StatusCategory[source]

Utility enum.Enum methods.

Create an extended enum with these utilities as follows.

class CustomEnum(ExtendedEnum):
    ItemA = "A"
    ItemB = "B"

Warning

Must not define any enum value here to allow inheritance by subclasses.

FINISHED = 'FINISHED'[source]
RUNNING = 'RUNNING'[source]
FAILED = 'FAILED'[source]
class weaver.status.Status[source]

Constants container that provides similar functionalities to ExtendedEnum without explicit Enum membership.

ACCEPTED = 'accepted'[source]
STARTED = 'started'[source]
PAUSED = 'paused'[source]
SUCCEEDED = 'succeeded'[source]
SUCCESSFUL = 'successful'[source]
FAILED = 'failed'[source]
RUNNING = 'running'[source]
DISMISSED = 'dismissed'[source]
EXCEPTION = 'exception'[source]
UNKNOWN = 'unknown'[source]
weaver.status.JOB_STATUS_CATEGORIES[source]
weaver.status.JOB_STATUS_CODE_API[source]
weaver.status.JOB_STATUS_SEARCH_API[source]
weaver.status.STATUS_PYWPS_MAP[source]
weaver.status.STATUS_PYWPS_IDS[source]
weaver.status.StatusType[source]
weaver.status.map_status(wps_status: AnyStatusType, compliant: StatusCompliant = StatusCompliant.OGC) StatusType[source]

Maps WPS execution statuses to between compatible values of different implementations.

Mapping is supported for values from weaver.status, OWSLib, pywps as well as some specific one-of values of custom implementations.

For each compliant combination, unsupported statuses are changed to corresponding ones (with closest logical match). Statuses are returned following Status format. Specifically, this ensures statues are lowercase and not prefixed by Process (as in XML response of OWS WPS like ProcessSucceeded for example).

Parameters:
  • wps_status – One of Status or its literal value to map to compliant standard.

  • compliant – One of StatusCompliant values.

Returns:

mapped status complying to the requested compliant category, or Status.UNKNOWN if no match found.

weaver.tweens
Module Contents
weaver.tweens.ViewHandler[source]
weaver.tweens.LOGGER[source]
weaver.tweens.OWS_TWEEN_HANDLED = 'OWS_TWEEN_HANDLED'[source]
weaver.tweens.error_repr(http_err: pyramid.httpexceptions.HTTPException | weaver.owsexceptions.OWSException | Exception) str[source]

Returns a cleaned up representation string of the HTTP error.

Similar and even extended details relative to the HTTP error message are added to facilitate later debugging.

weaver.tweens.ows_response_tween(request: weaver.typedefs.PyramidRequest, handler: ViewHandler) weaver.typedefs.AnyViewResponse[source]

Tween that wraps any API request with appropriate dispatch of error conversion to handle formatting.

weaver.tweens.ows_response_tween_factory_excview(handler: ViewHandler, registry: pyramid.registry.Registry) ViewHandler[source]

Tween factory which produces a tween which transforms common exceptions into OWS specific exceptions.

weaver.tweens.ows_response_tween_factory_ingress(handler: ViewHandler, registry: pyramid.registry.Registry) ViewHandler[source]

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: pyramid.config.Configurator) None[source]
weaver.typedefs
Module Contents
weaver.typedefs.FileSystemPathType[source]
weaver.utils
Module Contents
weaver.utils.RetryCondition[source]
weaver.utils.LOGGER[source]
weaver.utils.SUPPORTED_FILE_SCHEMES[source]
weaver.utils.FILE_NAME_LOOSE_PATTERN[source]
weaver.utils.FILE_NAME_QUOTE_PATTERN[source]
weaver.utils._LITERAL_VALUES_ATTRIBUTE = '__args__'[source]
weaver.utils.AWS_S3_REGIONS: List[mypy_boto3_s3.literals.RegionName][source]
weaver.utils.AWS_S3_REGIONS_REGEX[source]
weaver.utils.AWS_S3_ARN = 'arn:aws:s3'[source]
weaver.utils.AWS_S3_BUCKET_NAME_PATTERN[source]
weaver.utils.AWS_S3_BUCKET_ARN_PATTERN[source]
weaver.utils.AWS_S3_BUCKET_REFERENCE_PATTERN[source]
class weaver.utils.Lazify(func: Callable[[], weaver.typedefs.Return])[source]

Wraps the callable for evaluation only on explicit call or string formatting.

Once string representation has been computed, it will be cached to avoid regenerating it on following calls.

Initialize the lazy-string representation.

Parameters:

func – Callable that should return the computed string formatting.

class weaver.utils.CaseInsensitive(_str: str)[source]

str(object=’’) -> str str(bytes_or_buffer[, encoding[, errors]]) -> str

Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.__str__() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to ‘strict’.

Initialize self. See help(type(self)) for accurate signature.

__str[source]
weaver.utils.NUMBER_PATTERN[source]
weaver.utils.UNIT_SI_POWER_UP[source]
weaver.utils.UNIT_SI_POWER_DOWN = ['m', 'µ', 'n', 'p', 'f', 'a', 'z', 'y'][source]
weaver.utils.UNIT_BIN_POWER = ['Ki', 'Mi', 'Gi', 'Ti', 'Pi', 'Ei', 'Zi', 'Yi'][source]
weaver.utils.UUID_PATTERN[source]
class weaver.utils._Singleton[source]
class weaver.utils.NullType[source]

Represents a null value to differentiate from None.

weaver.utils.null[source]
class weaver.utils.SchemaRefResolver(base_uri: str, referrer: weaver.typedefs.OpenAPISchema, *_: Any, **__: Any)[source]

Reference resolver that supports both JSON and YAML files from a remote location.

resolve_remote(uri: str) weaver.typedefs.OpenAPISchema[source]

Resolve a remote uri.

If called directly, does not check the store first, but after retrieving the document at the specified URI it will be saved in the store if cache_remote is True.

Note

If the requests library is present, jsonschema will use it to request the remote uri, so that the correct encoding is detected and used.

If it isn’t, or if the scheme of the uri is not http or https, UTF-8 is assumed.

Arguments:

uri (str):

The URI to resolve

Returns:

The retrieved document

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: MutableMapping[str, Any], default: str | None = None, pop: bool = False, key: bool = False) str | None[source]

Retrieves a dictionary id-like key using multiple common variations [id, identifier, _id].

Parameters:
  • info – dictionary that potentially contains an id-like key.

  • default – Default identifier to be returned if none of the known keys were matched.

  • pop – If enabled, remove the matched key from the input mapping.

  • key – If enabled, return the matched key instead of the value.

Returns:

value of the matched id-like key or None if not found.

weaver.utils.get_any_value(info: MutableMapping[str, Any], default: Any = None, file: bool = True, data: bool = True, pop: bool = False, key: bool = False) weaver.typedefs.AnyValueType[source]

Retrieves a dictionary value-like key using multiple common variations [href, value, reference, data].

Parameters:
  • info – Dictionary that potentially contains a value-like key.

  • default – Default value to be returned if none of the known keys were matched.

  • file – If enabled, file-related key names will be considered.

  • data – If enabled, data-related key names will be considered.

  • pop – If enabled, remove the matched key from the input mapping.

  • key – If enabled, return the matched key instead of the value.

Returns:

Value (or key if requested) of the matched value-like key or None if not found.

weaver.utils.get_any_message(info: weaver.typedefs.JSON, default: str = '') str[source]

Retrieves a dictionary ‘value’-like key using multiple common variations [message, description, detail].

Parameters:
  • info – Dictionary that potentially contains a ‘message’-like key.

  • default – Default message if no variation could be matched.

Returns:

value of the matched ‘message’-like key or the default string if not found.

weaver.utils.is_celery() bool[source]

Detect if the current application was executed as a celery command.

weaver.utils.get_registry(container: weaver.typedefs.AnyRegistryContainer | None = None, nothrow: bool = False) pyramid.registry.Registry | None[source]

Retrieves the application registry from various containers referencing to it.

weaver.utils.get_settings(container: weaver.typedefs.AnySettingsContainer | None = 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, default: str | None, str | List[str] | None, bool = None, pop: bool = False, concat: bool = False) str | List[str] | None[source]

Find the specified header within a header container.

Retrieves header_name by fuzzy match (independently of upper/lower-case and underscore/dash) from various framework implementations of Headers.

Parameters:
  • header_name – Header to find.

  • header_container – Where to look for header_name.

  • default – Returned value if header_container is invalid or header_name is not found.

  • pop – Remove the matched header(s) by name from the input container.

  • concat – Allow parts of the header name to be concatenated without hyphens/underscores. This can be the case in some S3 responses. Disabled by default to avoid unexpected mismatches, notably for shorter named headers.

Returns:

Found header if applicable, or the default value.

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_request_args(request: weaver.typedefs.AnyRequestType) weaver.typedefs.AnyRequestQueryMultiDict[source]

Extracts the parsed query string arguments from the appropriate request object strategy.

Depending on the request implementation, attribute query_string are expected as bytes (werkzeug) or str (pyramid, webob). The query_string attribute is then used by args and params for respective implementations, but assuming their string-like formats are respected.

weaver.utils.parse_kvp(query: str, key_value_sep: str = '=', pair_sep: str = ';', nested_pair_sep: str | None = '', multi_value_sep: str | None = ',', accumulate_keys: bool = True, unescape_quotes: bool = True, strip_spaces: bool = True, case_insensitive: bool = True) weaver.typedefs.KVP[source]

Parse key-value pairs using specified separators.

All values are normalized under a list, whether their have an unique or multi-value definition. When a key is by itself (without separator and value), the resulting value will be an empty list.

When accumulate_keys is enabled, entries such as {key}={val};{key}={val} will be joined together under the same list as if they were specified using directly {key}={val},{val} (default separators employed only for demonstration purpose). Both nomenclatures can also be employed simultaneously.

When nested_pair_sep is provided, definitions that contain nested key_value_sep character within an already established KVP will be parsed once again. This will parse {key}={subkey1}={val1},{subkey2}={val2} into a nested KVP dictionary as value under the top level KVP entry {key}. Separators are passed down for nested parsing, except pair_sep that is replaced by nested_pair_sep.

>> parse_kvp("format=json&inputs=key1=value1;key2=val2,val3", pair_sep="&", nested_pair_sep=";")
{
    'format': ['json'],
    'inputs': {
        'key1': ['value1'],
        'key2': ['val2', 'val3']
    }
}
Parameters:
  • query – Definition to be parsed as KVP.

  • key_value_sep – Separator that delimits the keys from their values.

  • pair_sep – Separator that distinguish between different (key, value) entries.

  • nested_pair_sep – Separator to parse values of pairs containing nested KVP definition.

  • multi_value_sep – Separator that delimits multiple values associated to the same key. If empty or None, values will be left as a single entry in the list under the key.

  • accumulate_keys – Whether replicated keys should be considered equivalent to multi-value entries.

  • unescape_quotes – Whether to remove single and double quotes around values.

  • strip_spaces – Whether to remove spaces around values after splitting them.

  • case_insensitive – Whether to consider keys as case-insensitive. If True, resulting keys will be normalized to lowercase. Otherwise, original keys are employed.

Returns:

Parsed KVP.

Raises:

HTTPBadRequest – If parsing cannot be accomplished based on parsing conditions.

weaver.utils.parse_prefer_header_execute_mode(header_container: weaver.typedefs.AnyHeadersContainer, supported_modes: List[weaver.execute.AnyExecuteControlOption] | None = None, wait_max: int = 10) Tuple[weaver.execute.AnyExecuteMode, int | None, weaver.typedefs.HeadersType][source]

Obtain execution preference if provided in request headers.

See also

See also

If Prefer format is valid, but server decides it cannot be respected, it can be transparently ignored (RFC 7240#section-2). The server must respond with Preference-Applied indicating preserved preferences it decided to respect.

Parameters:
  • header_container – Request headers to retrieve preference, if any available.

  • supported_modes – Execute modes that are permitted for the operation that received the Prefer header. Resolved mode will respect this constraint following specification requirements of OGC API - Processes.

  • wait_max – Maximum wait time enforced by the server. If requested wait time is greater, wait preference will not be applied and will fall back to asynchronous response.

Returns:

Tuple of resolved execution mode, wait time if specified, and header of applied preferences if possible. Maximum wait time indicates duration until synchronous response should fall back to asynchronous response.

Raises:

HTTPBadRequest – If contents of Prefer are not valid.

weaver.utils.get_url_without_query(url: str | urllib.parse.ParseResult) str[source]

Removes the query string part of an URL.

weaver.utils.is_valid_url(url: str | None) typing_extensions.TypeGuard[str][source]
class weaver.utils.VersionLevel[source]

Constants container that provides similar functionalities to ExtendedEnum without explicit Enum membership.

MAJOR = 'major'[source]
MINOR = 'minor'[source]
PATCH = 'patch'[source]
class weaver.utils.VersionFormat[source]

Constants container that provides similar functionalities to ExtendedEnum without explicit Enum membership.

OBJECT = 'object'[source]
STRING = 'string'[source]
PARTS = 'parts'[source]
weaver.utils.as_version_major_minor_patch(version: weaver.typedefs.AnyVersion, version_format: weaver.typedefs.Literal[VersionFormat]) weaver.compat.Version[source]
weaver.utils.as_version_major_minor_patch(version: weaver.typedefs.AnyVersion, version_format: weaver.typedefs.Literal[VersionFormat]) str
weaver.utils.as_version_major_minor_patch(version: weaver.typedefs.AnyVersion, version_format: weaver.typedefs.Literal[VersionFormat]) Tuple[int, int, int]
weaver.utils.as_version_major_minor_patch(version: weaver.typedefs.AnyVersion) Tuple[int, int, int]

Generates a MAJOR.MINOR.PATCH version with padded with zeros for any missing parts.

weaver.utils.is_update_version(version: weaver.typedefs.AnyVersion, taken_versions: Iterable[weaver.typedefs.AnyVersion], version_level: VersionLevel = VersionLevel.PATCH) typing_extensions.TypeGuard[weaver.typedefs.AnyVersion][source]

Determines if the version corresponds to an available update version of specified level compared to existing ones.

If the specified version corresponds to an older version compared to available ones (i.e.: a taken more recent version also exists), the specified version will have to fit within the version level range to be considered valid. For example, requesting PATCH level will require that the specified version is greater than the last available version against other existing versions with equivalent MAJOR.MINOR parts. If 1.2.0 and 2.0.0 were taken versions, and 1.2.3 has to be verified as the update version, it will be considered valid since its PATCH number 3 is greater than all other 1.2.x versions (it falls within the [1.2.x, 1.3.x[ range). Requesting instead MINOR level will require that the specified version is greater than the last available version against existing versions of same MAJOR part only. Using again the same example values, 1.3.0 would be valid since its MINOR part 3 is greater than any other 1.x taken versions. On the other hand, version 1.2.4 would not be valid as x = 2 is already taken by other versions considering same 1.x portion (PATCH part is ignored in this case since MINOR is requested, and 2.0.0 is ignored as not the same MAJOR portion of 1 as the tested version). Finally, requesting a MAJOR level will require necessarily that the specified version is greater than all other existing versions for update, since MAJOR is the highest possible semantic part, and higher parts are not available to define an upper version bound.

Note

As long as the version level is respected, the actual number of this level and all following ones can be anything as long as they are not taken. For example, PATCH with existing 1.2.3 does not require that the update version be 1.2.4. It can be 1.2.5, 1.2.24, etc. as long as 1.2.x is respected. Similarly, MINOR update can provide any PATCH number, since 1.x only must be respected. From existing 1.2.3, MINOR update could specify 1.4.99 as valid version. The PATCH part does not need to start back at 0.

Parameters:
  • version – Version to validate as potential update revision.

  • taken_versions – Existing versions that cannot be reused.

  • version_level – Minimum level to consider availability of versions as valid revision number for update.

Returns:

Status of availability of the version.

weaver.utils.is_uuid(maybe_uuid: Any) typing_extensions.TypeGuard[weaver.typedefs.AnyUUID][source]

Evaluates if the provided input is a UUID-like string.

weaver.utils.as_int(value: Any, default: int) int[source]

Ensures a value is converted to int.

weaver.utils.parse_extra_options(option_str: str, sep: str = ',') Dict[str, str | None][source]

Parses the extra options parameter.

The option_str is a string with coma separated opt=value pairs.

tempdir=/path/to/tempdir,archive_root=/path/to/archive
Parameters:
  • option_str – A string parameter with the extra options.

  • sep – separator to employ in order to split the multiple values within the option string.

Returns:

A dict with the parsed extra options.

weaver.utils.extend_instance(obj: OriginalClass, cls: Type[ExtenderMixin]) ExtendedClass[source]

Extend an existing instance of a given class by applying new definitions from the specified mixin class type.

weaver.utils.fully_qualified_name(obj: Any | Type[Any]) str[source]

Obtains the full path definition of the object to allow finding and importing it.

For classes, functions and exceptions, the following format is returned:

module.name

The module is omitted if it is a builtin object or type.

For methods, the class is also represented, resulting in the following format:

module.class.name
weaver.utils.import_target(target: str, default_root: str | None = None) Any | None[source]

Imports a target resource class or function from a Python script as module or directly from a module reference.

The Python script does not need to be defined within a module directory (i.e.: with __init__.py). Files can be imported from virtually anywhere. To avoid name conflicts in generated module references, each imported target employs its full escaped file path as module name.

Formats expected as follows:

"path/to/script.py:function"
"path/to/script.py:Class"
"module.path.function"
"module.path.Class"
Parameters:
  • target – Resource to be imported.

  • default_root – Root directory to employ if target is relative (default magpie.constants.MAGPIE_ROOT).

Returns:

Found and imported resource or None.

weaver.utils.open_module_resource_file(module: str | types.ModuleType, file_path: str) IO[str][source]

Opens a resource (data file) from an installed module.

Returns:

File stream handler to read contents as needed.

weaver.utils.now(tz_name: str | None = None) datetime.datetime[source]

Obtain the current time with timezone-awareness.

Parameters:

tz_name – If specified, returned current time will be localized to specified timezone.

weaver.utils.wait_secs(run_step: int = -1) int[source]

Obtain a wait time in seconds within increasing delta intervals based on iteration index.

weaver.utils.localize_datetime(dt: datetime.datetime, tz_name: str | None = None) datetime.datetime[source]

Provide a timezone-aware datetime for a given datetime and timezone name.

Warning

Any datetime provided as input that is not already timezone-aware will be assumed to be relative to the current locale timezone. This is the default returned by naive datetime.datetime instances.

If no timezone name is provided, the timezone-aware datatime will be localized with locale timezone offset. Otherwise, the desired localization will be applied with the specified timezone offset.

weaver.utils.get_file_header_datetime(dt: datetime.datetime) str[source]

Obtains the standard header datetime representation.

See also

Format of the date defined in RFC 5322#section-3.3.

weaver.utils.get_href_headers(path: str, download_headers: bool = False, location_headers: bool = True, content_headers: bool = False, content_type: str | None = None, settings: weaver.typedefs.SettingsType | None = None, **option_kwargs) MetadataResult[source]

Obtain headers applicable for the provided file or directory reference.

Return type:

object

Parameters:
  • path – File to describe. Either a local path or remote URL.

  • download_headers – If enabled, add the Content-Disposition header with attachment filename for downloading the file. If the reference is a directory, this parameter is ignored, since files must be retrieved individually.

  • location_headers – If enabled, add the Content-Location header referring to the input location.

  • content_headers – If enabled, add other relevant Content- prefixed headers.

  • content_type – Explicit Content-Type to provide. Otherwise, use default guessed by file system (often application/octet-stream). If the reference is a directory, this parameter is ignored and application/directory will be enforced.

  • settings – Application settings to pass down to relevant utility functions.

Returns:

Headers for the reference.

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.xml_util.XML) None[source]
weaver.utils.ows_context_href(href: str, partial: bool | None = False) weaver.typedefs.JSON[source]

Retrieves the complete or partial dictionary defining an OWSContext from a reference.

weaver.utils.pass_http_error(exception: Exception, expected_http_error: Type[pyramid.httpexceptions.HTTPError] | Iterable[Type[pyramid.httpexceptions.HTTPError]]) None[source]

Silently ignore a raised HTTP error that matches the specified error code of the reference exception class.

Given an HTTPError of any type (pyramid, requests), ignores the exception if the actual error matches the status code. Other exceptions are re-raised. This is equivalent to capturing a specific Exception within an except block and calling pass to drop it.

Parameters:
  • exception – Any Exception instance.

  • 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.xml_util.XML) NoReturn | None[source]

Raises an exception with the description if the XML response document defines an ExceptionReport.

Parameters:

xml_node – instance of XML

Raises:

Exception – on found ExceptionReport document.

weaver.utils.str2bytes(string: AnyStr) bytes[source]

Obtains the bytes representation of the string.

weaver.utils.bytes2str(string: AnyStr) 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.get_path_kvp(path: str, sep: str = ',', **params: weaver.typedefs.KVP_Item) str[source]

Generates the 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: weaver.status.Status | str, message: str, progress: weaver.typedefs.Number | None = 0, duration: str | None = None) str[source]
weaver.utils.setup_loggers(settings: weaver.typedefs.AnySettingsContainer | None = None, level: int | str | None = None, force_stdout: bool = False, message_format: str | None = None, datetime_format: str | None = None, log_file: str | None = None) logging.Logger[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: str, mode: int = 493, exist_ok: bool = False) None[source]

Backward compatible make_dirs with reduced set of default mode flags.

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: int = 0, base_class: bool = False) str[source]

Find the name of a parent caller function or method.

The name is returned with respective formats module.class.method or module.function.

Supposing the following call stack main -> func1 -> func2 -> func3 -> get_caller_name.

Calling get_caller_name() or get_caller_name(skip=1) would return the full package location of func2 because it is 1-level higher than were get_caller_name is called from (inside func3). Calling get_caller_name(skip=0) would return func3 directly, and func1 for get_caller_name(skip=2).

Parameters:
  • skip – Specifies how many levels of stack to skip for getting the caller. By default, uses skip=1 to obtain the immediate parent function that called get_caller_name(), were skip=0 would be the function itself that called get_caller_name().

  • 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, reset: bool = True) None[source]

Prepares the settings with default caching options.

weaver.utils.reset_cache(regions: List[str] | None = None) None[source]

Invalidates caches for all regions and functions decorated by beaker.cache.cache_region() or manually cached.

Parameters:

regions – List of specific regions to reset. Others are unmodified. If omitted, clear all caches regardless of regions.

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) representing caching key to invalidate.

weaver.utils.get_ssl_verify_option(method: str, url: str, settings: weaver.typedefs.AnySettingsContainer, request_options: weaver.typedefs.SettingsType | None = None) bool[source]

Obtains the SSL verification option considering multiple setting definitions and the provided request context.

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 preloaded request options specifications.

  • request_options – preprocessed request options for method/URL to avoid parsing the settings again.

Returns:

SSL verify option to be passed down to some request function.

weaver.utils.get_no_cache_option(request_headers: weaver.typedefs.HeadersType, **cache_options: bool) 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.

  • cache_options – specific request options that could define cache[_enabled]: True|False.

Returns:

whether to disable cache or not

weaver.utils.get_request_options(method: str, url: str, settings: weaver.typedefs.AnySettingsContainer) RequestOptions[source]

Obtains the request options corresponding to the request from the configuration file.

The configuration file specified is expected to be pre-loaded within 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_condition(operation: weaver.typedefs.AnyCallableAnyArgs, *args: RetryCondition, condition: int = Exception, retries: weaver.typedefs.Number = 1, interval=0, **kwargs) weaver.typedefs.Return[source]

Retries the operation call up to the amount of specified retries if the condition is encountered.

Parameters:
  • operation – Any callable lambda, function, method, class that sporadically raises an exception to catch.

  • condition – Exception(s) to catch or callable that takes the raised exception to handle it with more conditions. In case of a callable, success/failure result should be returned to indicate if retry is needed. If retry is not requested by the handler for the specified exception, it is raised directly.

  • retries – Amount of retries to perform. If retries are exhausted, the final exception is re-raised.

  • interval – wait time interval (seconds) between retries.

Returns:

Expected normal operation return value if it was handled within the specified amount of retries.

weaver.utils.retry_on_cache_error(func: weaver.typedefs.AnyCallable) weaver.typedefs.AnyCallable[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: weaver.typedefs.AnyRequestMethod, url: str, kwargs: RequestCachingKeywords) requests.Response[source]

Request operation employed by request_extra() without caching.

weaver.utils._request_cached(method: weaver.typedefs.AnyRequestMethod, url: str, kwargs: RequestCachingKeywords) requests.Response[source]

Cached-enabled request operation employed by request_extra().

weaver.utils._patch_cached_request_stream(response: weaver.typedefs.AnyResponseType, stream: bool = False) None[source]

Preserves a cached copy of a streamed response contents to allow resolution when reloaded from cache.

When response contents are streamed, the resulting Response object does not contain the contents until the aggregated result is obtained by calling Response.contents(), Response.text() or Response.`json() methods. If no function ends up being called to aggregate the chunks with Response.contents(), and instead makes use of one of the interator Response.iter_contents(), Response.iter_lines() or Response.__iter__() methods, the object stored in cache ends up in an invalid state where it believes contents were already consumed (cannot re-iterate), but are not available anymore to provide them on following request calls that reloads it from cache. This patches the object by caching the contents after iterating the chunks to allow them to be retrieved for future cached requests.

weaver.utils.request_extra(method: weaver.typedefs.AnyRequestMethod, url: str, retries: int | None = None, backoff: weaver.typedefs.Number | None = None, intervals: List[weaver.typedefs.Number] | None = None, retry_after: bool = True, allowed_codes: List[int] | None = None, only_server_errors: bool = True, ssl_verify: bool | None = None, cache_request: RequestCachingFunction = _request_cached, cache_enabled: bool = True, settings: weaver.typedefs.AnySettingsContainer | None = 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 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.

param method:

HTTP method to set request.

param url:

URL of the request to execute.

param retries:

Number of request retries to attempt if first attempt failed (according to allowed codes or error).

param backoff:

Factor by which to multiply delays between retries.

param intervals:

Explicit intervals in seconds between retries.

param retry_after:

If enabled, honor Retry-After response header of provided by a failing request attempt.

param allowed_codes:

HTTP status codes that are considered valid to stop retrying (default: any non-4xx/5xx code).

param ssl_verify:

Explicit parameter to disable SSL verification (overrides any settings, default: True).

param cache_request:

Decorated function with cache_region() to perform the request if cache was not hit.

param cache_enabled:

Whether caching must be used for this request. Disable overrides request options and headers.

param settings:

Additional settings from which to retrieve configuration details for requests.

param 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.

param request_kwargs:

All other keyword arguments are passed down to the request call.

weaver.utils.get_secure_filename(file_name: str) str[source]

Obtain a secure file name.

Preserves leading and trailing underscores contrary to secure_filename().

weaver.utils.get_secure_directory_name(location: str) str[source]

Obtain a secure directory name from a full path location.

Takes a location path and finds the first secure base name available from path. If no secure base name is found, a random UUID value will be returned.

weaver.utils.get_secure_path(location: str) str[source]

Obtain a secure path location with validation of each nested component.

weaver.utils.download_file_http(file_reference: str, file_outdir: str, settings: weaver.typedefs.AnySettingsContainer | None = None, callback: Callable[[str], None] | None = None, **request_kwargs: Any) str[source]

Downloads the file referenced by an HTTP URL location.

Respects RFC 2183, RFC 5987 and RFC 6266 regarding Content-Disposition header handling to resolve any preferred file name. This value is employed if it fulfills validation criteria. Otherwise, the name is extracted from the last part of the URL path.

Parameters:
  • file_reference – HTTP URL where the file is hosted.

  • file_outdir – Output local directory path under which to place the downloaded file.

  • settings – Additional request-related settings from the application configuration (notably request-options).

  • callback – Function that gets called progressively with incoming chunks from downloaded file. Can be used to monitor download progress or raise an exception to abort it.

  • 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 unrecoverable problem occurred during fetch request.

  • ValueError – when resulting file name value is considered invalid.

weaver.utils.validate_s3(*, region: Any, bucket: str) None[source]

Validate patterns and allowed values for AWS S3 client configuration.

weaver.utils.resolve_s3_from_http(reference: str) Tuple[str, mypy_boto3_s3.literals.RegionName][source]

Resolve an HTTP URL reference pointing to an S3 Bucket into the shorthand URL notation with S3 scheme.

The expected reference should be formatted with one of the following supported formats.

# Path-style URL
https://s3.{Region}.amazonaws.com/{Bucket}/[{dirs}/][{file-key}]

# Virtual-hosted–style URL
https://{Bucket}.s3.{Region}.amazonaws.com/[{dirs}/][{file-key}]

# Access-Point-style URL
https://{AccessPointName}-{AccountId}.s3-accesspoint.{Region}.amazonaws.com/[{dirs}/][{file-key}]

# Outposts-style URL
https://{AccessPointName}-{AccountId}.{outpostID}.s3-outposts.{Region}.amazonaws.com/[{dirs}/][{file-key}]
Parameters:

reference – HTTP-S3 URL reference.

Returns:

Updated S3 reference and applicable S3 Region name.

weaver.utils.resolve_s3_reference(s3_reference: str) Tuple[str, str, mypy_boto3_s3.literals.RegionName | None][source]

Resolve a reference of S3 scheme into the appropriate formats expected by boto3.

Parameters:

s3_reference – Reference with s3:// scheme with an ARN or literal Bucket/Object path.

Returns:

Tuple of resolved Bucket name, Object path and S3 Region.

weaver.utils.resolve_s3_http_options(**request_kwargs: Any) Dict[str, botocore.config.Config | weaver.typedefs.JSON][source]

Converts HTTP requests options to corresponding S3 configuration definitions.

Resolved parameters will only preserve valid options that can be passed directly to botocore.client.S3 when initialized with boto3.client() in combination with "s3" service. Valid HTTP requests options that have been resolved will be nested under config with a S3Config where applicable.

Parameters:

request_kwargs – Request keywords to attempt mapping to S3 configuration.

Returns:

Resolved S3 client parameters.

weaver.utils.resolve_scheme_options(**kwargs: Any) Tuple[SchemeOptions, RequestOptions][source]

Splits options into their relevant group by scheme prefix.

Handled schemes are defined by SUPPORTED_FILE_SCHEMES. HTTP and HTTPS are grouped together and share the same options.

Parameters:

kwargs – Keywords to categorise by scheme.

Returns:

Categorised options by scheme and all other remaining keywords.

class weaver.utils.OutputMethod[source]

Methodology employed to handle generation of a file or directory output that was fetched.

AUTO = 'auto'[source]
MOVE = 'move'[source]
COPY = 'copy'[source]
META = 'meta'[source]
weaver.utils.fetch_file(file_reference: str, file_outdir: str, *, out_method: OutputMethod = OutputMethod.AUTO, settings: weaver.typedefs.AnySettingsContainer | None = None, callback: Callable[[str], None] | None = None, **option_kwargs) str[source]

Fetches a file from local path, AWS-S3 bucket or remote URL, and dumps its content to the 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 (after link resolution if applicable). 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).

  • callback – Function that gets called progressively with incoming chunks from downloaded file. Only applicable when download occurs (remote file reference). Can be used to monitor download progress or raise an exception to abort it.

  • out_method – Method employed to handle the generation of the output file. Only applicable when the file reference is local. Remote location always generates a local copy.

  • option_kwargs – Additional keywords to forward to the relevant handling method by scheme. Keywords should be defined as {scheme}_{option} with one of the known SUPPORTED_FILE_SCHEMES. If not prefixed by any scheme, the option will apply to all handling methods (if applicable).

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.adjust_file_local(file_reference: str, file_outdir: str, out_method: OutputMethod) AnyOutputResult[source]

Adjusts the input file reference to the output location with the requested handling method.

Handling Methods
  • OutputMethod.LINK:

    Force generation of a symbolic link instead of hard copy, regardless if source is directly a file or a link to one.

  • OutputMethod.COPY:

    Force hard copy of the file to destination, regardless if source is directly a file or a link to one.

  • OutputMethod.MOVE:

    Move the local file to the output directory instead of copying or linking it. If the output directory already contains the local file, raises an OSError.

  • OutputMethod.AUTO (default):

    Resolve conditionally as follows.

    • When the source is a symbolic link itself, the destination will also be a link.

    • When the source is a direct file reference, the destination will be a hard copy of the file.

param file_reference:

Original location of the file.

param file_outdir:

Target directory of the file.

param out_method:

Method employed to handle the generation of the output.

returns:

Output file location or metadata.

weaver.utils.filter_directory_forbidden(listing: Iterable[FilterType], key: Callable[[Ellipsis], str] | None = None) Iterator[FilterType][source]

Filters out items that should always be removed from directory listing results.

class weaver.utils.PathMatchingMethod[source]

Utility enum.Enum methods.

Create an extended enum with these utilities as follows.

class CustomEnum(ExtendedEnum):
    ItemA = "A"
    ItemB = "B"

Warning

Must not define any enum value here to allow inheritance by subclasses.

GLOB = 'glob'[source]
REGEX = 'regex'[source]
weaver.utils.filter_directory_patterns(listing: Iterable[FilterType], include: Iterable[str] | None, exclude: Iterable[str] | None, matcher: PathMatchingMethod, key: Callable[[Ellipsis], str] | None = None) List[FilterType][source]

Filters a list of files according to a set of include/exclude patterns.

If a file is matched against an include pattern, it will take precedence over matches on exclude patterns. By default, any file that is not matched by an excluded pattern will remain in the resulting filtered set. Include patterns are only intended to “add back” previously excluded matches. They are NOT for defining “only desired items”. Adding include patterns without exclude patterns is redundant, as all files would be retained by default anyway.

Patterns can use regular expression definitions or Unix shell-style wildcards. The matcher should be selected accordingly to provided patterns matching method. Potential functions are re.match(), re.fullmatch(), fnmatch.fnmatch(), fnmatch.fnmatchcase() Literal strings for exact matches are also valid.

Note

Provided patterns are applied directly without modifications. If the file listing contains different root directories than patterns, such as if patterns are specified with relative paths, obtained results could mismatch the intended behavior. Make sure to align paths accordingly for the expected filtering context.

Parameters:
  • listing – Files to filter.

  • include – Any matching patterns for files that should be explicitly included.

  • exclude – Any matching patterns for files that should be excluded unless included.

  • matcher – Pattern matching method to evaluate if a file path matches include and exclude definitions.

  • key – Function to retrieve the file key (path) from objects containing it to be filtered.

Returns:

Filtered files.

weaver.utils.fetch_files_s3(location: str, out_dir: weaver.typedefs.Path, out_method: AnyMetadataOutputMethod, include: List[str] | None = None, exclude: List[str] | None = None, matcher: PathMatchingMethod = PathMatchingMethod.GLOB, settings: weaver.typedefs.SettingsType | None = None, **option_kwargs) List[MetadataResult][source]
weaver.utils.fetch_files_s3(location: str, out_dir: weaver.typedefs.Path, out_method: AnyDownloadOutputMethod, include: List[str] | None = None, exclude: List[str] | None = None, matcher: PathMatchingMethod = PathMatchingMethod.GLOB, settings: weaver.typedefs.SettingsType | None = None, **option_kwargs) List[DownloadResult]

Download all listed S3 files references under the output directory using the provided S3 bucket and client.

If nested directories are employed in the file paths, they will be downloaded with the same directory hierarchy under the requested output directory.

See also

Filtering is subject to filter_directory_patterns() and filter_directory_forbidden().

Parameters:
  • location – S3 bucket location (with s3:// scheme) targeted to retrieve files.

  • out_dir – Desired output location of downloaded files.

  • out_method – Method employed to handle the generation of the output.

  • include – Any matching patterns for files that should be explicitly included.

  • exclude – Any matching patterns for files that should be excluded unless included.

  • matcher – Pattern matching method to evaluate if a file path matches include and exclude definitions.

  • settings – Additional request-related settings from the application configuration (notably request-options).

  • option_kwargs – Additional keywords to forward to the relevant handling method by scheme. Keywords should be defined as {scheme}_{option} with one of the known SUPPORTED_FILE_SCHEMES. If not prefixed by any scheme, the option will apply to all handling methods (if applicable).

Returns:

Output locations of downloaded files.

weaver.utils.fetch_files_url(file_references: Iterable[str], out_dir: weaver.typedefs.Path, out_method: AnyOutputMethod, base_url: str, include: List[str] | None = None, exclude: List[str] | None = None, matcher: PathMatchingMethod = PathMatchingMethod.GLOB, settings: weaver.typedefs.SettingsType | None = None, **option_kwargs) Iterator[AnyOutputResult][source]

Download all listed files references under the output directory.

If nested directories are employed in file paths, relative to base_url, they will be downloaded with the same directory hierarchy under the requested output directory. If the base_url differs, they will simply be downloaded at the root of the output directory. If any conflict occurs in such case, an OSError will be raised.

See also

Use download_files_s3() instead if all files share the same S3 bucket.

Parameters:
  • file_references – Relative or full URL paths of the files to download.

  • out_dir – Desired output location of downloaded files.

  • out_method – Method employed to handle the generation of the output.

  • base_url – If full URL are specified, corresponding files will be retrieved using the appropriate scheme per file allowing flexible data sources. Otherwise, any relative locations use this base URL to resolve the full URL prior to downloading the file.

  • include – Any matching patterns for files that should be explicitly included.

  • exclude – Any matching patterns for files that should be excluded unless included.

  • matcher – Pattern matching method to evaluate if a file path matches include and exclude definitions.

  • settings – Additional request-related settings from the application configuration (notably request-options).

  • option_kwargs – Additional keywords to forward to the relevant handling method by scheme. Keywords should be defined as {scheme}_{option} with one of the known SUPPORTED_FILE_SCHEMES. If not prefixed by any scheme, the option will apply to all handling methods (if applicable).

Returns:

Output locations of downloaded files.

weaver.utils.fetch_files_html(html_data: str, out_dir: weaver.typedefs.Path, out_method: AnyMetadataOutputMethod, base_url: str, include: List[str] | None = None, exclude: List[str] | None = None, matcher: PathMatchingMethod = PathMatchingMethod.GLOB, settings: weaver.typedefs.AnySettingsContainer | None = None, **option_kwargs) Iterator[MetadataResult][source]
weaver.utils.fetch_files_html(html_data: str, out_dir: weaver.typedefs.Path, out_method: AnyDownloadOutputMethod, base_url: str, include: List[str] | None = None, exclude: List[str] | None = None, matcher: PathMatchingMethod = PathMatchingMethod.GLOB, settings: weaver.typedefs.AnySettingsContainer | None = None, **option_kwargs) Iterator[DownloadResult]

Retrieves files from a directory listing provided as an index of plain HTML with file references.

If the index itself provides directories that can be browsed down, the tree hierarchy will be downloaded recursively by following links. In such case, links are ignored if they cannot be resolved as a nested index pages.

Retrieval of file references from directory listing attempts to be as flexible as possible to the HTML response format, by ignoring style tags and looking only for <a href=""/> references. Examples of different supported format representations are presented at following locations:

Parameters:
  • html_data – HTML data contents with files references to download.

  • out_dir – Desired output location of retrieved files.

  • out_method – Method employed to handle the generation of the output.

  • base_url – If full URL are specified, corresponding files will be retrieved using the appropriate scheme per file allowing flexible data sources. Otherwise, any relative locations use this base URL to resolve the full URL prior to downloading the file.

  • include – Any matching patterns for files that should be explicitly included.

  • exclude – Any matching patterns for files that should be excluded unless included.

  • matcher – Pattern matching method to evaluate if a file path matches include and exclude definitions.

  • settings – Additional request-related settings from the application configuration (notably request-options).

  • option_kwargs – Additional keywords to forward to the relevant handling method by scheme. Keywords should be defined as {scheme}_{option} with one of the known SUPPORTED_FILE_SCHEMES. If not prefixed by any scheme, the option will apply to all handling methods (if applicable).

Returns:

Output locations of downloaded files.

weaver.utils.adjust_directory_local(location: weaver.typedefs.Path, out_dir: weaver.typedefs.Path, out_method: AnyMetadataOutputMethod, include: List[str] | None = None, exclude: List[str] | None = None, matcher: PathMatchingMethod = PathMatchingMethod.GLOB) List[MetadataResult][source]
weaver.utils.adjust_directory_local(location: weaver.typedefs.Path, out_dir: weaver.typedefs.Path, out_method: AnyDownloadOutputMethod, include: List[str] | None = None, exclude: List[str] | None = None, matcher: PathMatchingMethod = PathMatchingMethod.GLOB) List[DownloadResult]

Adjusts the input directory reference to the output location with the requested handling method.

Handling Methods
  • Source location is the output directory:

    If the source location is exactly the same location as the output (after link resolution), nothing is applied, unless filtered listing produces a different set of files. In that case, files to be excluded will be removed from the file system. In other situations, below handling methods are considered.

  • OutputMethod.LINK:

    Force generation of the output directory as a symbolic link pointing to the original location, without any copy, regardless if the source location is directly a directory or a link to one. Not applicable if filtered listing does not match exactly the original source location listing. In such case, resolution will use the second OutputMethod.AUTO handling approach instead.

  • OutputMethod.COPY:

    Force hard copy of the directory to the destination, and hard copy of all its underlying contents by resolving any symbolic link along the way, regardless if the source location is directly a directory or a link to one.

  • OutputMethod.MOVE:

    Move the local directory’s contents under the output directory instead of copying or linking it. If the output directory already contains anything, raises an OSError. If exclusion filters yield any item to be omitted, those items will be deleted entirely from the file system.

  • OutputMethod.AUTO (default):

    Resolve conditionally as follows.

    • When the source is a symbolic link itself, the destination will be a link to it (handled as OutputMethod.LINK), unless its restriction regarding filtered listing applies. In that case, switches to the other handling method below.

    • When the source is a direct directory reference (or a link with differing listing after filter), the destination will be a recursive copy of the source directory, but any encountered links will remain links instead of resolving them and creating a copy (as accomplished by OutputMethod.COPY).

param location:

Local reference to the source directory.

param out_dir:

Local reference to the output directory.

param out_method:

Method employed to handle the generation of the output.

param include:

Any matching patterns for files that should be explicitly included.

param exclude:

Any matching patterns for files that should be excluded unless included.

param matcher:

Pattern matching method to evaluate if a file path matches include and exclude definitions.

returns:

Listing of files after resolution and filtering if applicable.

weaver.utils.list_directory_recursive(directory: weaver.typedefs.Path, relative: bool = False) Iterator[weaver.typedefs.Path][source]

Obtain a flat list of files recursively contained within a local directory.

weaver.utils.fetch_directory(location: str, out_dir: weaver.typedefs.Path, *, out_method: AnyMetadataOutputMethod = OutputMethod.AUTO, include: List[str] | None = None, exclude: List[str] | None = None, matcher: PathMatchingMethod = PathMatchingMethod.GLOB, settings: weaver.typedefs.AnySettingsContainer | None = None, **option_kwargs) List[MetadataResult][source]
weaver.utils.fetch_directory(location: str, out_dir: weaver.typedefs.Path, *, out_method: AnyDownloadOutputMethod = OutputMethod.AUTO, include: List[str] | None = None, exclude: List[str] | None = None, matcher: PathMatchingMethod = PathMatchingMethod.GLOB, settings: weaver.typedefs.AnySettingsContainer | None = None, **option_kwargs) List[DownloadResult]

Fetches all files that can be listed from a directory in local or remote location.

Note

When using include/exclude filters, items that do not match a valid entry from the real listing are ignored. Special directories such as .. and . for navigation purpose are always excluded regardless of filters.

Parameters:
  • location – Directory reference (URL, S3, local). Trailing slash required.

  • out_dir – Output local directory path under which to place fetched files.

  • out_method – Method employed to handle the generation of the output directory. Only applicable when the file reference is local. Remote location always generates a local copy.

  • include – Any matching patterns for files that should be explicitly included.

  • exclude – Any matching patterns for files that should be excluded unless included.

  • matcher – Pattern matching method to evaluate if a file path matches include and exclude definitions.

  • settings – Additional request-related settings from the application configuration (notably request-options).

  • option_kwargs – Additional keywords to forward to the relevant handling method by scheme. Keywords should be defined as {scheme}_{option} with one of the known SUPPORTED_FILE_SCHEMES. If not prefixed by any scheme, the option will apply to all handling methods (if applicable).

Returns:

File locations retrieved from directory listing.

weaver.utils.fetch_reference(reference: str, out_dir: weaver.typedefs.Path, *, out_listing: weaver.typedefs.Literal[False] = False, out_method: OutputMethod = OutputMethod.AUTO, settings: weaver.typedefs.AnySettingsContainer | None = None, **option_kwargs) str[source]
weaver.utils.fetch_reference(reference: str, out_dir: weaver.typedefs.Path, *, out_listing: weaver.typedefs.Literal[True] = False, out_method: OutputMethod = OutputMethod.AUTO, settings: weaver.typedefs.AnySettingsContainer | None = None, **option_kwargs) List[str]

Fetches the single file or nested directory files from a local or remote location.

The appropriate method depends on the format of the location. If conditions from Directory Type are met, the reference will be considered a Directory. In every other situation, a single File reference will be considered.

See also

See the relevant handling methods below for other optional arguments.

Parameters:
  • reference – Local filesystem path (optionally prefixed with file://), s3:// bucket location or http(s):// remote URL file or directory reference. Reference https://s3.[...] are also considered as s3://.

  • out_dir – Output local directory path under which to place the fetched file or directory.

  • out_listing – Request that the complete file listing of the directory reference is returned. Otherwise, return the local directory reference itself. In the event of a file reference as input, the returned path will always be the fetched file itself, but it will be contained within a single-item list if listing was True for consistency in the returned type with the corresponding call for a directory reference.

  • settings – Additional request-related settings from the application configuration (notably request-options).

  • out_method – Method employed to handle the generation of the output file or directory. Only applicable when the reference is local. Remote location always generates a local copy.

  • option_kwargs – Additional keywords to forward to the relevant handling method by scheme. Keywords should be defined as {scheme}_{option} with one of the known SUPPORTED_FILE_SCHEMES. If not prefixed by any scheme, the option will apply to all handling methods (if applicable).

Returns:

Path of the local copy of the fetched file, the directory, or the listing of the directory files.

Raises:
  • HTTPException – applicable HTTP-based exception if any occurred during the operation.

  • ValueError – when the reference scheme cannot be identified.

class weaver.utils.SizedUrlHandler(value, ref)[source]

Avoids an unnecessary request to obtain the content size if the expected file is already available locally.

property size[source]

Get content-length of URL without download

Generates a MetaLink definition with provided link references.

If the link includes a local file path, or when the href itself is a local path, the IO handler will employ those references to avoid the usual behavior performed by pywps that auto-fetches the remote file. To retain that behavior, simply make sure that href is a remote file and that path is unset or does not exist.

Parameters:
  • files – File link, and optionally, with additional name, local path, media-type and encoding.

  • version – Desired metalink content as defined by the corresponding version.

  • name – Global name identifier for the metalink file.

  • workdir – Location where to store files when auto-fetching them.

Returns:

Metalink object with appropriate template generation utilities.

Note

It is always preferable to use MetaLink V4 over V3 as it adds support for mediaType which can be critical for validating and/or mapping output formats in some cases. V3 also enforces “type=http” in the pywps XML template, which is erroneous when other schemes such as file:// or s3:// are employed.

Warning

Regardless of MetaLink V3 or V4, encoding are not reported. This is a limitation of MetaLink specification itself.

weaver.utils.load_file(file_path: str, text: bool = False) weaver.typedefs.JSON | str[source]

Load JSON or YAML file contents from local path or remote URL.

If URL, get the content and validate it by loading, otherwise load file directly.

Parameters:
  • file_path – Local path or URL endpoint where file to load is located.

  • text – load contents as plain text rather than parsing it from JSON/YAML.

Returns:

loaded contents either parsed and converted to Python objects or as plain text.

Raises:

ValueError – if YAML or JSON cannot be parsed or loaded from location.

weaver.utils.is_remote_file(file_location: str) typing_extensions.TypeGuard[str][source]

Parses to file location to figure out if it is remotely available or a local path.

weaver.utils.REGEX_SEARCH_INVALID_CHARACTERS[source]
weaver.utils.REGEX_ASSERT_INVALID_CHARACTERS[source]
weaver.utils.get_sane_name(name: str, min_len: int | None = 3, max_len: int | None | None = None, assert_invalid: bool | None = True, replace_character: str = '_') str | None[source]

Cleans up the name to allow only specified characters and conditions.

Returns a cleaned-up version of the name, replacing invalid characters not matched with REGEX_SEARCH_INVALID_CHARACTERS by replace_character. Also, ensure that the resulting name respects specified length conditions.

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: str, min_len: int = 3, max_len: int | None = None) 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, convert_quotes: 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: Dict[str, weaver.typedefs.JSON], rename: Dict[weaver.typedefs.AnyKey, Any] | None = None, remove: List[weaver.typedefs.AnyKey] | None = None, add: Dict[weaver.typedefs.AnyKey, Any] | None = None, replace_values: Dict[weaver.typedefs.AnyKey, Any] | None = None, replace_func: Dict[weaver.typedefs.AnyKey, Callable[[Any], Any]] | None = None) Dict[str, weaver.typedefs.JSON][source]

Transforms the input JSON with different methods.

The transformations are applied in-place and in the same order as the arguments (rename, remove, add, etc.). All operations are applied onto the top-level fields of the mapping. No nested operations are applied, unless handled by replace functions.

Note

Because fields and values are iterated over the provided mappings, replacements of previous iterations could be re-replaced by following ones if the renamed item corresponds to a following item to match. For example, renaming field1 -> field2 and field2 -> field3` within the same operation type would result in successive replacements with ``field3 as result. The parameter order is important in this case as swapping the definitions would not find field2 on the first iteration (not in mapping yet), and then find field1, making the result to be field2.

Parameters:
  • json_data – JSON mapping structure to transform.

  • rename – rename matched fields key name to the associated value name.

  • remove – remove matched fields by name.

  • add – add or override the fields names with associated values.

  • replace_values – replace matched values by the associated new values regardless of field names.

  • replace_func – Replace values under matched fields by name with the returned value from the associated function. Mapping functions will receive the original value as input. If the result is to be serialized to JSON, they should return a valid JSON-serializable value.

Returns:

transformed JSON (same as modified in-place input JSON).

weaver.utils.generate_diff(val: Any, ref: Any, val_name: str = 'Test', ref_name: str = 'Reference', val_show: bool = False, ref_show: bool = False, json: bool = True, indent: int | None = 2) str[source]

Generates a line-by-line diff result of the test value against the reference value.

Attempts to parse the contents as JSON to provide better diff of matched/sorted lines, and falls back to plain line-based string representations otherwise.

Parameters:
  • val – Test input value.

  • ref – Reference input value.

  • val_name – Name to apply in diff for test input value.

  • ref_name – Name to apply in diff for reference input value.

  • val_show – Whether to include full contents of test value.

  • ref_show – Whether to include full contents of reference value.

  • json – Whether to consider contents as JSON for diff evaluation.

  • indent – Indentation to employ when using JSON contents.

Returns:

Formatted multiline diff,

weaver.utils.apply_number_with_unit(number: weaver.typedefs.Number, unit: str = '', binary: bool = False, decimals: int = 3) str[source]

Apply the relevant unit and prefix factor to the specified number to create a human-readable value.

Parameters:
  • number – Numeric value with no unit.

  • unit – Unit to be applied. Auto-resolved to ‘B’ if binary requested. Factor applied accordingly to number.

  • binary – Use binary multiplier (powers of 2) instead of SI decimal multipliers (powers of 10).

  • decimals – Number of decimals to preserve after unit is applied.

Returns:

String of the numeric value with appropriate unit.

weaver.utils.parse_number_with_unit(number: str, binary: bool | None = None) weaver.typedefs.Number[source]

Parses a numeric value accompanied by a unit to generate the unit-less value without prefix factor.

Parameters:
  • number – Numerical value and unit. Unit is dissociated from value with first non-numerical match. Unit is assumed to be present (not only the multiplier by itself). This is important to avoid confusion (e.g.: m used for meters vs m prefix for “milli”).

  • binary – Force use (True) or non-use (False) of binary multiplier (powers of 2) instead of SI decimal multipliers (powers of 10) for converting value (with applicable unit multiplier if available). If unspecified (None), auto-detect from unit (e.g.: powers of 2 for MiB, powers of 10 for MB). When unspecified, the B character is used to auto-detect if binary should apply, SI multipliers are otherwise assumed.

Returns:

Literal value.

weaver.utils.copy_doc(copy_func: weaver.typedefs.AnyCallableAnyArgs) weaver.typedefs.AnyCallableAnyArgs[source]

Decorator to copy the docstring from one callable to another.

copy_doc(self.copy_func)(self.func)

@copy_doc(func)
def copy_func(self): pass
weaver.visibility
Module Contents
class weaver.visibility.Visibility[source]

Constants container that provides similar functionalities to ExtendedEnum without explicit Enum membership.

PUBLIC = 'public'[source]
PRIVATE = 'private'[source]
weaver.visibility.AnyVisibility[source]
weaver.warning

Warnings emitted during the weaver flow.

Module Contents
exception weaver.warning.WeaverWarning[source]

Base class of Warning defined by weaver package.

Initialize self. See help(type(self)) for accurate signature.

exception weaver.warning.UndefinedContainerWarning[source]

Warn when settings or the registry could not be resolved from an explicit container reference.

Initialize self. See help(type(self)) for accurate signature.

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.

weaver.xml_util

Define a default XML parser that avoids XXE injection.

Package lxml is employed directly even though some linters (e.g.: bandit) report to employ defusedxml instead, because that package’s extension with lxml is marked as deprecated.

To use the module, import is as if importing lxml.etree:

from weaver.xml_util import XML  # ElementTree
from weaver import xml_util

data = xml_util.fromstring("<xml>content</xml>")
Module Contents
weaver.xml_util.XML_PARSER[source]
weaver.xml_util.tostring[source]
weaver.xml_util.Element[source]
weaver.xml_util.ParseError[source]
weaver.xml_util.XML[source]
weaver.xml_util.XMLTree[source]
weaver.xml_util._lxml_fromstring[source]
weaver.xml_util.fromstring(text: AnyStr, parser: lxml.etree.XMLParser = XML_PARSER) XML[source]
weaver.xml_util.parse(source: str | io.BufferedReader, parser: lxml.etree.XMLParser = XML_PARSER) XMLTree[source]
weaver.xml_util.HTML[source]
weaver.xml_util._lxml_tree_parser_maker(**parser_kwargs: Any) lxml.etree.HTMLParser[source]

Generate the XML/HTML tree parser.

Uses similar parameters as in bs4.builder._lxml.LXMLTreeBuilderForXML.default_parser(), but overriding some other options to make it more secure.

Without this modification, the builder is usually created using:

etree.XMLParser(target=self, strip_cdata=False, recover=True, encoding=encoding)
weaver.xml_util.HTML_PARSER[source]
weaver.xml_util.HTML_TREE_BUILDER[source]
weaver.xml_util.LXML_TREE_BUILDER[source]
Package Contents
weaver.LOGGER[source]
weaver.WEAVER_MODULE_DIR[source]
weaver.WEAVER_ROOT_DIR[source]
weaver.WEAVER_CONFIG_DIR[source]
weaver.WEAVER_SCHEMA_DIR[source]
weaver.main(global_config: typedefs.SettingsType, **settings: Any) pyramid.router.Router[source]
weaver.includeme(config: pyramid.config.Configurator) None[source]

Changes

Unreleased (latest)

Changes:
  • No change.

Fixes:
  • No change.

5.0.0 (2023-12-12)

Changes:
  • Add weaver.formats.ContentEncoding with handlers for common encoding manipulation from input values.

  • Add EchoProcess to the list of weaver.processes.builtin definitions with its CWL representation and complementary OGC API - Processes reference implementation details. This Process will be automatically deployed at API startup, and is employed to validate multiple parsing combinations of execution I/O values and encodings (fixes #379).

  • Add support of OGC BoundingBox definition (bbox and crs fields) as Process execution input value with appropriate schema validation (fixes #51).

  • Add support of Unit of Measure (UoM) definition (measurement and uom fields) as Process execution input value with appropriate schema validation (fixes #430).

  • Add create_metalink utility function to facilitate generation of a .meta4 or .metalink file definition from a list of file link references (relates to #25).

Fixes:
  • Fix weaver.wps_restapi.swagger_definitions.ExecuteInputValues deserialization that sometimes silently dropped invalid JSON-formatted inputs that did not fulfill schema validation. This was caused by a side effect regarding how weaver.wps_restapi.colander_extras.VariableSchemaNode handled “unknown” JSON properties from submitted content. In cases where required Process inputs were causing the invalid schema, Job execution would be aborted and the error would be reported due to “missing” inputs. However, if the JSON failing schema validation happened to be nested under an optional input definition, the Job execution could have resumed silently by omitting this input’s value propagation to the downstream CWL, WPS or OGC API - Processes implementation, which could make it use an alternative default value than the real input that was submitted for the Job.

  • Fix schema name representation employed in generated colander.Invalid error when a schema validation failed, in order to better represent deeply nested schema using multiple oneOf, anyOf, allOf schema nodes. Using colander.Invalid.asdict, each dictionary key now properly indicates the specific path of sub-nodes with their relevant schema validation error.

  • Fix variable schema node names to provide a {SchemaName}<{VariableName}> representation, such that it can be more easily identified. Schema nodes with a variable (i.e.: schema under additionalProperties) previously only indicated {VariableName}, which made it complicated to follow reference schema classes that formed the error path. Each of the evaluated fields against each possible variable schema will now report their corresponding nested schema validation error as {SchemaName}<{VariableName}>({field}) such that results can be understood.

  • Fix execution input reference (i.e.: using href) dropping a schema URL reference if provided explicitly. This parameter now remains within the produced content passed to the Job, and forwarded to a remote Process if applicable, but no further schema validation is accomplished with the value in schema for the moment.

  • Fix ContentType.IMAGE_OGC_GEOTIFF using invalid media-type name (missing i in image).

  • Fix Job input validation stripping additional parameters from provided Media-Type, potentially causing mismatching Content-Type validation against the corresponding Process description inputs. Types should now match exactly the original Process definition, including any additional parameters and sub-types.

  • Fix resolution of anyOf schema raising colander.Invalid even when the property was marked as optional using missing=colander.drop.

  • Fix $schema of OGC nameReferenceType being reported under every dataType of literalDataDomains for literal I/O of Process descriptions. The reference is not only included in the OpenAPI definition as intended.

  • Fix override of CWL stderr and stdout definitions if specified by the original Application Package for its own implementation. These stream handles are added to the CWL by Weaver to provide more contextual debugging and traceability details of the internal application executed by the Process. However, a package making use of this functionality of CWL to capture an output file would be broken unless naming the file exactly as stderr.log and stdout.log. Weaver will now employ the parameters provided by the Application Package if specified.

4.38.0 (2023-11-24)

Changes:
Fixes:
  • No change.

4.37.0 (2023-11-22)

Changes:
  • No change.

Fixes:
  • Fix default XML format resolution for WPS endpoint when no Accept header or format/f query parameter is provided and that the request is submitted from a Web Browser, which involves additional control logic to select the applicable Content-Type for the response.

  • Fix pre-forked celery worker process inconsistently resolving the pyramid registry applied by pyramid_celery after worker restart.

4.36.0 (2023-11-06)

Changes:
  • Drop Python 3.7 support.

  • Add Python 3.12 to GitHub CI experimental builds.

  • Bump werkzeug>=3.0.1 to resolve security vulnerability from the package.

Fixes:
  • No change.

4.35.0 (2023-11-03)

Changes:
  • Add more secure path validations steps before fetching contents.

  • Disallow builtin processes expecting a user-provided input path to run with local file references such that they must respect any configured server-side remote file access rules instead of bypassing security validations through resolved local paths.

  • Add multiple validation checks for more secure file paths handling when retrieving contents from remote locations.

  • Add more tests to validate core code paths of builtin Process jsonarray2netcdf, metalink2netcdf and file_index_selector with validation of happy path and error handling conditions.

Fixes:
  • Fix invalid parsing of XML Metalink files in metalink2netcdf. Metalink V3 and V4 will now properly consider the namespace and specific content structure to extract the NetCDF URL reference, and the Process will validate that the extracted reference respects the NetCDF extension.

4.34.0 (2023-10-16)

Changes:
  • Add alternate references, as Link header and within the JSON content links property when applicable, in the returned Process description response to refer between the XML and the corresponding JSON representations.

  • Support alternative representations from OGC API - Processes schemas for executionUnit definition during Process deployment. The unit does not need to be nested under unit or a list anymore, and can instead be directly provided as JSON mapping. For backward compatibility, the previous list representation is still allowed (fixes #507).

  • Support an additional type property along a unit item describing an executionUnit to specify an IANA Media-Type that categories the unit contents, similarly to how it could be provided for its href counterpart. For the moment, only CWL-based unit are supported, but this could allow future extensions to provide alternate representations of an Application Package.

  • Add schema validation and reference to the API landing page, with additional parameters to respect OGC schema.

  • Add multiple JSON schema references for schema classes that are represented by corresponding OGC definitions.

  • Add Job subscribers support to define OGC-compliant callback URLs where HTTP(S) requests will be sent upon reaching certain Job status milestones (resolves #230).

  • Add email notification support to the new subscribers definition (extension over OGC minimal requirements).

  • Deprecate Job notification_email in the OpenAPI specification in favor of subscribers, but preserve parsing of its value if provided in the JSON body during Job submission for backward compatibility support of existing servers. The Job.notification_email attribute is removed to avoid duplicate references.

  • Add notification email for Job started status, only available through the subscribers property.

  • Add CLI and WeaverClient options to support subscribers specification for submitted Job execution.

  • Add {PROCESS_ID}/{STATUS}.mako template detection under the weaver.wps_email_notify_template_dir location to allow per-Process and per-Job status email customization.

  • Refactor weaver/notify.py and weaver/processes/execution.py to avoid mixed references to the encryption/decryption logic employed for notification emails. All notifications including emails and callback requests are now completely handled and contained in the weaver/notify.py module.

  • Remove partially duplicate Mako Template definition as hardcoded string and separate file for email notification.

Fixes:
  • Fix inconsistent or missing schema references to updated OGC schema locations, and align their based URL locations for corresponding /conformance endpoint reporting.

  • Fix auto-insertion of $schema and $id URI references into JSON schema and their data content representation. When in OpenAPI context, schemas now correctly report their $id as the reference schema they represent (usually from external OGC schema references), and $schema as the JSON meta-schema. When representing JSON data contents validated against a JSON schema, the $schema property is used instead to refer to that schema. All auto-insertions of these references can be enabled or disabled with options depending on what is more sensible for presenting results from various API responses.

  • Fix weaver.cli logger not properly configured when executed from CLI causing log messages to not be reported.

4.33.0 (2023-10-06)

Changes:
  • Add utility methods for Job to easily retrieve its various URLs.

  • Add weaver.wps_email_notify_timeout setting (default 10s) to avoid SMTP server deadlock on failing connection.

  • Modify the encrypt_email function to use an alternate strategy allowing decrypt_email on Job completed.

  • Remove notification_email from GET /jobs query parameters. Due to the nature of the encryption strategy, this cannot be supported anymore.

  • Add CLI execute options --output-public/-oP and --output-context/-oC OUTPUT_CONTEXT that add the specified X-WPS-Output-Context header to request the relevant output storage location of Job results.

Fixes:
  • Fix Job submitted with a notification_email not reversible from its encrypted value to retrieve the original email on Job completion to send the notification (fixes #568).

  • Fix example Mako Template for email notification using an unavailable property ${logs}. Instead, the new utility methods job.[...]_url should be used to retrieve relevant locations.

4.32.0 (2023-09-25)

Changes:
  • Add GET /providers/{provider_id}/processes/{process_id}/package endpoint that allows retrieval of the CWL Application Package definition generated for the specific Provider’s Process definition.

  • Add CLI package operation to request the remote Provider or local Process CWL Application Package.

  • Add CLI output reporting of performed HTTP requests details when using the --debug/-d option.

  • Modify default behavior of visibility field (under processDescription or processDescription.process) to employ the expected functionality by native OGC API - Processes clients that do not support this option (i.e.: public by default), and to align resolution strategy with deployments by direct CWL payload which do not include this feature either. A Process deployment that desires to employ this feature (visibility: private) will have to provide the value explicitly, or update the deployed Process definition afterwards with the relevant PUT request. Since public will now be used by default, the CLI will not automatically inject the value in the payload anymore when omitted.

  • Remove attribute WpsProcessInterface.stage_output_id_nested and enforce the behavior of nesting output by ID under corresponding directories for all remote Process execution when resolving CWL Workflow steps. This ensures a more consistent file and directory resolution between steps of different nature (CWL, WPS, OGC based) using multiple combinations of glob patterns and expected media-types.

Fixes:
  • Fix missing Node.js requirement in built Docker image in order to evaluate definitions that employ CWL InlineJavascriptRequirement, such as valueFrom employed for numeric Enum input type validation.

  • Fix processes.wps_package.WpsPackage.make_inputs unable to parse multi-type CWL definitions due parsing as single-type element with parse_cwl_array_type. Function get_cwl_io_type is used instead to resolve any CWL type combination properly.

  • Fix get_cwl_io_type function that would modify the I/O definition passed as argument, which could lead to failing CWL class reference resolutions later on due to different type with org.w3id.cwl.cwl prefix simplified before cwltool had the chance to resolve them.

  • Fix links listing duplicated in response from Process deployment. Links will only be listed within the returned processSummary to respect the OGC API - Processes schema.

  • Fix CLI not removing embedded links in processSummary from deploy operation response when -nL/--no-links option is specified.

  • Fix CWL definitions combining nested enum types as ["null", <enum>, {type: array, items: <enum>] without an explicit name or SchemaDefRequirement causing failing schema_salad resolution under cwltool. A patch is applied for the moment to inject a temporary name to let the CWL engine succeed schema validation (relates to common-workflow-language/cwltool#1908).

4.31.0 (2023-09-14)

Changes:
  • Add the official CWL JSON schema reference (common-workflow-language/cwl-v1.2#256) as $schema parameter returned in under the OpenAPI schema for the CWL component employed by Weaver (fixes #547).

  • Add $schema field auto-insertion into the generated OpenAPI schema definition by CorniceSwagger when corresponding colander.SchemaNode definitions contain a _schema = "<URL>" attribute (fixes #157).

  • Drop Python 3.6 support.

Fixes:
  • Fix broken OpenAPI schema link references to OGC API - Processes repository.

  • Fix GET /providers/{provider_id} response using $schema instead of $id to provide its content schema.

  • Fix Job creation failing when submitting an empty string as input for a Process that allows it due to schema validation incorrectly preventing it.

  • Fix human-readable JSON-like content cleanup to preserve sequences of quotes corresponding to valid empty strings.

  • Fix WPS I/O integer literal data conversion to OpenAPI I/O schema definition injecting an invalid format: double property due to type checking with float succeeding against int values.

  • Fix CWL I/O value validation for enum-like definitions from corresponding OpenAPI and WPS I/O. Since CWL I/O do not allow Enum type for values other than basic string type, valueFrom attribute is used to handle int, float and bool types, using an embedded JavaScript validation against allowed values. Because of this validation strategy, CWL packages must now include InlineJavascriptRequirement when allowed values for these basic types must be performed in order for the CWL engine to parse I/O contents of valueFrom (relates to cwl-v1.2#267, common-workflow-language#764 and common-workflow-language#907).

  • Fix typing definitions for certain Literal references for proper resolution involving values stored in constants.

  • Fix get_sane_name checks performed on Process ID and Service name to use min_len=1 in order to allow valid WPS process definition on existing servers to resolve references that are shorter than the previous default of 3 characters.

4.30.1 (2023-07-07)

Changes:
  • No change.

Fixes:

4.30.0 (2023-03-24)

Changes:
  • Add weaver.quotation = true|false setting that allows control over the activation of all endpoints and operations related to the OGC API - Processes Billing and Quotation extensions.

  • Add support to configure a quotation estimation algorithm for each respective Process with new requests using GET, PUT, DELETE methods on /processes/{processID}/estimator endpoint. The configured algorithm is provided by a reference Docker image defined by weaver.quotation_docker_[...] settings. The algorithm itself expects a highly customizable configuration to estimate quotation parameters based on conceptual categories, as defined by the Quote Estimator Configuration schema optionally using versatile ONNX definitions. The Docker operation should return a JSON matching the Quote Estimation Result schema, which is parsed and included in the produced Quote based on provided Process execution parameters.

  • Add Process execution I/O pre-validation against the Process description before submitting the Job to avoid unnecessary allocation of computing resources for erroneous cases that can easily be detected in advance.

  • Add $schema references to source OGC API - Processes or other schema registries for applicable content definitions in responses.

  • Add missing OGC API - Processes schema references with published definitions under https://schemas.opengis.net/ogcapi/processes/part1/1.0/ when applicable.

  • Add links request query parameter to /processes and /providers/{providerID}/processes listing to provide control over reporting of links for each Process summary item. By default, link=true and automatically disable it when detail=false is specified.

  • Add missing 405 response schema for all OpenAPI endpoints as handled by the API when the requested HTTP method is not applicable for the given path.

  • Renamed weaver.quote_sync_max_wait to weaver.quotation_sync_max_wait to better align with new configuration settings for the Quotation extension. Old value will still be checked for backward compatibility.

  • Renamed weaver.exec_sync_max_wait to weaver.execute_sync_max_wait to better align with the corresponding parameter for quotation. Old value will still be checked for backward compatibility.

  • Add Lazify utility class for holding a string with delayed computation and caching that returns its representation on-demand during formatting or other string operations to reduce the impact of its long generation. This can be used with a callable returning a string representation that can be discarded without invocation on inactive logging levels.

  • Add count field to JSON output of endpoints that support paging to provide the number of items returned within the paged result. Adjust the /quotations endpoint that was using it instead of total like it was done on other listing endpoints.

  • Add detail query parameter for the /quotations endpoint to allow listing of Quote summary details instead of only IDs by default, similarly to the /jobs endpoint.

Fixes:
  • Fix schema meta fields (title, summary, description, etc.) not being rendered in OpenAPI output for keyword schemas (allOf, anyOf, oneOf, not).

  • Fix schema definitions not being rendered in OpenAPI into the requested order by _sort_first and _sort_after control attributes.

  • Fix request cache always invalidated when no explicit allowed_codes where provided in request_extra, although the request succeeded, causing caching optimization to never actually be used on following requests in this case.

  • Fix cached requests misbehaving when combined with stream=True argument due to contents not being stored in the object for following requests, causing them to raise StreamConsumedError when calling the chunk iterator again.

  • Fix execution payloads for functional tests using WorkflowRESTScatterCopyNetCDF, WorkflowRESTSelectCopyNetCDF, WorkflowWPS1ScatterCopyNetCDF and``WorkflowWPS1SelectCopyNetCDF`` processes, which requested invalid output identifiers. Those erroneous definitions were detected using the new Process execution I/O pre-validation against the corresponding Process descriptions on Job submission.

4.29.0 (2023-03-07)

Changes:
  • Replace deprecated best_match methods for Accept and Accept-Language HTTP headers by their respective implementation with acceptable_offers and lookup methods better aligned with RFC 7231 specification.

Fixes:
  • Fix missing sphinx_autodoc_typehints[type_comment] extras due to renamed definition without leading s by pinning 1.19 as the minimum version (relates to tox-dev/sphinx-autodoc-typehints#263).

  • Fix dynamic regex definitions for schema validation with colander>=2 that modifies URL_REGEX pattern (relates to Pylons/colander#352).

  • Fix invalid default results from colander schemas with missing=drop|required and default parameters when combined with cornice OpenAPI schemas. Pin colander<2 to avoid problems with latest changes.

  • Fix secure_filename causing valid names with leading or trailing underscores to be incorrectly unresolved because they get stripped out by the operation.

  • Fix input-location definition for PACKAGE_DIRECTORY_TYPE input in weaver.processes.wps_package.WpsPackage.make_location_input, which caused the wrong directory being given to the CWL application.

  • Fix http directory download to match implemented AWS S3 directory download in weaver.utils.fetch_directory, so both types replicate the input directory’s top level folder, which is necessary when downloading multiple directories for the same input source.

  • Fix deprecation warnings from webob and owslib.

  • Fix filtered warnings for expected cases during tests.

  • Fix a problem with convert_input_values_schema under the OGC schema, that caused the conversion to malfunction when the function built lists for repeated input IDs of more than two elements.

  • Fix XML security vulnerability from owslib<0.28.1.

4.28.0 (2022-12-06)

Changes:
  • Update Docker images to use more recent Python 3.10 by default instead of Python 3.7. All CI pipeline, tests and validation checks are also performed with Python 3.10. Unit and functional tests remain evaluated for all Python versions since 3.6 (legacy) up to 3.11 (experimental).

  • Update to latest cwltool==3.1.20221201130942 to provide v1.2 extension definitions.

  • Add CWL extensions activation for specific features supported by Weaver for more adequate schema validation.

  • Add Job log message size checks to better control what gets logged during the Application Package execution to avoid large documents causing problems when attempting save them to storage database.

  • Update documentation with examples for cwltool:CUDARequirement, ResourceRequirement and NetworkAccess.

  • Improve schema definition of ResourceRequirement.

  • Deprecate DockerGpuRequirement, with attempts to auto-convert it into corresponding DockerRequirement combined with cwltool:CUDARequirement definitions. If this conversion does not work transparently for the user, explicit CWL updates with those definitions should be made.

  • Ensure that validation check finds exactly one provided CWL requirement or hint to represent the application type. In case of missing requirement, the Process deployment will fail with a reported error that contains a documentation link to guide the user in adjusting its Application Package accordingly.

Fixes:
  • Fix CI failing setup of Python 3.6 not available on Ubuntu 22.04 (latest).

  • Fix distutils.version.LooseVersion marked for deprecation for upcoming versions. Use packaging.version.Version substitute whenever possible, but preserve backward compatibility with distutils in case of older Python not supporting it.

  • Fix cli._update_files so there are no attempts to upload remote references to the Vault.

4.27.0 (2022-11-22)

Changes:
  • Support CWL InlineJavascriptRequirement for Process deployment to allow successful schema validation.

  • Support CWL Directory type references (resolves #466). Those references correspond to WPS and OGC API - Processes href using the Content-Type: application/directory Media-Type and must hava a trailing slash (/) character.

  • Support S3 file or directory references using Access Point, Virtual-hosted–style and Outposts URLs (see AWS documentation Methods for accessing a bucket).

  • Apply more validation rules against expected S3 file or directory reference formats.

  • Update documentation regarding handling of S3 references (more formats supported) and Directory type references.

  • Support weaver.wps_output_context setting and X-WPS-Output-Context request header resolution in combination with S3 bucket location employed for storing Job outputs.

  • Nest every complex Job output (regardless if stored on local WPS outputs or on S3, and whether the output is of File or Directory type) under its corresponding output ID collected from the Process definition to avoid potential name conflicts in storage location, especially in the case of multiple output IDs that could be aggregated with various files and listing of directory contents.

  • Allow colander.SchemaNode (with extensions for OpenAPI schema converters) to provide validation pattern field directly with a compiled re.Pattern object.

  • Support CWL definition for cwltool:CUDARequirement to request the use of a GPU, including support for using Docker with a GPU (resolves #104).

  • Support CWL definition for NetworkAccess to indicate whether a process requires outgoing IPv4/IPv6 network access.

Fixes:
  • Fix cli._update_files so there are no attempts to upload remote references to the vault.

4.26.0 (2022-10-31)

Changes:
  • Add more explicit PackageException error messages with contextual details when a CWL file reference cannot be resolved correctly.

  • Return Content-Type: application/vnd.oai.openapi+json; version=3.0 for OpenAPI endpoint response referenced by service-desc in the API conformance details, as specified by OGC API - Processes - OpenAPI 3.0 requirement class.

  • Support the generation of external schema references ($ref) using the schema_ref attribute if provided in a colander.SchemaNode that does not provide an explicit object schema definition with properties.

  • Add Python typing definitions related to OpenAPI specification.

  • Add more validation of request arguments for improved security.

Fixes:
  • Fix invalid generation of OpenAPI 3.0 specification for Weaver API using cornice_swagger. The generated schema structure used to return a mix of Swagger 2.0 and OpenAPI 3.0 definitions. The provided contents are now defined completely with OpenAPI 3.0 specification format.

  • Remove hard requirement shapely==1.8.2 to obtain latest fixes.

  • Update json2xml>=3.20.0 requirement to allow more recent certifi, requests and urllib3 dependencies to be used by all packages (relates to vinitkumar/json2xml#157).

  • Fix resolution of CWL file from references that do not provide a known Content-Type that can represent CWL contents. This can occur when deploying a builtin Process from the local file reference, which does not generate a request and, therefore, no Content-Type. This can occur also for servers that incorrectly or simply do not report their response Content-Type header.

  • Fix resolution of file reference with explicit CWL or YAML extensions when Content-Type is not reported or is indicated as plain/text.

  • Fix invalid resolution of builtin Process that could load the optional JSON or YAML payload file intended to provide additional Process definition details, instead of the expected CWL for the package definition.

  • Fix kombu package requirement to employ celery>=5.2 with pymongo>=4 (fixes #386, relates to celery/celery#7834, relates to celery/kombu#1536).

  • Fix deprecated Cursor.count() call for Quote and Bill search with pymongo>=4.

  • Fix unsupported Process-related queries including a tagged version when searching for Job items.

4.25.0 (2022-10-05)

Changes:
  • Refactor weaver.processes.wps_workflow definitions to delegate implementation to cwltool core classes, removing code duplication and allowing update to latest revisions (resolves #154).

Fixes:
  • No change.

4.24.0 (2022-09-29)

Changes:
  • Support deployment of a local Process using a remote OGC API - Processes reference (resolves #11).

  • Support CWL definition for ScatterFeatureRequirement for Workflow parallel step distribution of an input array (resolves #105 and relates to #462).

  • Add formatter and better logging details when executing builtin Process jsonarray2netcdf.

  • Add OGC Media-Type ontology for File format references within CWL definition.

  • Replace EDAM NetCDF format reference by OGC NetCDF Media-Type with expected ontology definitions by processes For backward compatibility, corresponding EDAM references will be converted to OGC Media-Type whenever possible.

  • Adjust builtin process jsonarray2netcdf (version 2.0) to employ OGC Media-Type for NetCDF.

  • Adjust schema input of jsonarray2netcdf to avoid erroneous definition exposing a JSON object structure as a valid format, although a JSON array type is directly expected in the submitted JSON file.

  • Add support of builtin Process description overrides if provided along their CWL package definition. Overrides can be specified as JSON or YAML, and follow the same merging strategies of fields as normal deployments.

  • Refactor weaver.processes.wps_[...] definitions to reuse operations for communicating with OGC API - Processes servers across implementation for monitored Job with a remote Process type of OGC API, ADES and Workflow with other step Process references.

Fixes:
  • Fix implementation of various functional test cases for Workflow execution.

  • Fix owslib version with enforced pyproj dependency failing in Python 3.10 (resolves #459).

4.23.0 (2022-09-12)

Changes:
  • Add CLI and WeaverClient support of logs, exceptions and statistics retrieval.

  • Add CLI and WeaverClient support of Job search filtered by tags, process and providers queries.

  • Add CLI, WeaverClient and API support of Job search filtered by multiple status values.

  • Adjust OpenAPI schema definitions for Process deployment to allow owsContext by itself without duplicated information that was required by mandatory executionUnit definition.

Fixes:
  • Fix tags query parameter not applied to filter Job search requests.

  • Fix implementation of functional DockerRequirement test cases for Process deployment when references are provided by href within the executionUnit or owsContext (relates to #11).

  • Fix weaver.wps_output_context sub-directory resolved from default settings or X-WPS-Output-Context request header not employed for storing the XML status location and Job log files next to the Job outputs directory.

4.22.0 (2022-08-18)

Changes:
  • Add WPS remote Provider retry conditions to handle known problematic cases during Process execution (on remote) that can lead to sporadic failures of the monitored Job. When possible, retried submission leading to successful execution will result in the monitored Job to complete successfully and transparently to the user. Relevant errors and retry attempts are provided in the Job logs.

  • Add WPS remote Provider status exception response as XML message from the failed remote execution within the monitored local Job logs to help users understand how to resolve any encountered issue on the remote service.

Fixes:
  • Bump version OWSLib==0.26.0 to fix processVersion attribute resolution from WPS remote Provider definition to populate Process.version property employed in converted Process description to OGC API - Process schema (relates to geopython/OWSLib#794).

  • Fixes and improvements for typing definitions.

4.21.0 (2022-08-15)

Changes:
  • Add CLI support for Process listing, Job execution, service registration and un-registration in the context of a Process offered by a remote Provider reference.

  • Add CLI options for Process listing with detailed descriptions, paging, limit and sorting queries.

  • Add CLI options for HTTP request timeout and retry control when required for specific use cases. For example, a Weaver instance with many registered Provider references could take longer than default timeout of 5s to populate the full list of remotely accessible processes retrieved from each WPS service.

  • Add CLI output of most recently retrieved Job status during execute operation in combination of monitoring flag to report the produced Job reference ID and URL in case monitoring timeout is reached before its completion.

  • Add support of XML content for Process description response from the REST API endpoint based on the WPS definition when any query between schema=WPS, f=xml, format=xml or the Accept header referring to XML Media-Type is identified in the request (resolves #125).

  • Add support of f and format query parameters to describe a Process with JSON when requested from the WPS endpoint with redirect to REST API URL (resolves #125).

  • Add support of Job submission with WPS-like XML content and HTTP POST request directly submitted through the OGC APi - Processes REST endpoint. Response is returned in JSON regardless of WPS-like Job submission in order to provide the status response (resolves #125).

Fixes:
  • Fix invalid POST /providers/{provider_id}/processes/{process_id}/execution endpoint that was missing the Process portion to mimic the OGC API - Processes execution endpoint of a Job for a remote Provider.

  • Fix result file names resolution for staging outputs retrieved from the Job execution on a remote Provider where the Process outputs files are not generated using the same glob naming convention as expected by the CWL outputs of the corresponding Process.

  • Fix Job submission response generation potentially duplicating Content-Type and Content-Length headers.

4.20.0 (2022-07-15)

Changes:
  • Add support of Process revisions (resolves #107).

  • Add PATCH /processes/{processID} request, allowing MINOR and PATCH level modifications that can be applied to an existing Process in order to revise non-execution critical information. Level PATCH is used to identify changes with no impact on execution whatsoever, only affecting metadata such as its documented description. Level MINOR is used to update components that affect only execution methodology (e.g.: sync/async) or Process retrieval, but that do not directly impact what is executed (i.e.: the Application Package does not change).

  • Add PUT /processes/{processID} request, allowing MAJOR revision to essentially redeploy a new Process, but leaving some form of relationship with older versions by reusing the same Process ID. This MAJOR update level implies a relatively critical change to execute the Process, such as the addition, removal or modification of an input or output, directly impacting the Application Package definition and parameters the Process offers.

  • Add support of {processID}:{version} representation in request path and processID of the Job definition to reference the specific Process revisions when fetching a Process description or a Job status.

  • Add search query version and revisions parameters to allow description of a specific Process revision, or listing all its versions history.

  • Add more entries in links referring to Process revisions whenever applicable.

Fixes:
  • Fix CLI not allowing expected combination of --username and --password for Docker authentication when deploying a Process that needs it to retrieve the referenced repository and image in its CWL definition.

  • Fix invalid minimum and maximum OpenAPI fields that were defined as minLength and maxLength (duplicates definitions) for Process description and deployment schema validation.

4.19.0 (2022-07-05)

Changes:
  • Add support of official CWL IANA types to allow Process deployment with the relevant Content-Type header for the submitted payload (see common-workflow-language/common-workflow-language#421 (comment), relates to opengeospatial/NamingAuthority#169, resolves #434).

  • Support Process deployment using only CWL content provided it contains an id field representing the target Process ID as per recommendation in OGC Best Practice for Earth Observation Application Package, CWL Document (resolves #434).

  • Support Process deployment with a payload using YAML content instead of JSON. This YAML content MUST be submitted in the request with a Content-Type header either equal to application/x-yaml or application/ogcapppkg+yaml for the OGC Application Package schema, or using application/cwl+yaml for a CWL-only definition. The definition will be loaded and converted to JSON for schema validation. Otherwise, JSON contents is assumed to be directly provided in the request payload for validation as previously accomplished.

  • Add partial support of CWL with $graph representation for the special case where the graph is composed of a list of exactly one Application Package. Multi/nested-CWL definitions are NOT supported (relates to #56).

  • Add weaver.cwl_processes_dir configuration setting for preloading, registering or updating a set of known Process definitions from CWL files stored in a nested directory structure. This allows a service provider that uses Weaver to offer their Processes to directly maintain their definitions from the set of CWL files and upload changes in the web application at startup without need to manually undeploy and redeploy each Process.

  • Add weaver.cwl_processes_register_error to fail fast any Process registration error from CWL when loading files at startup.

Fixes:
  • Fix Process deployment using a WPS-1/2 URL reference defining a GetCapabilities request to resolve the corresponding DescribeProcess request if the Process ID can be inferred from other known locations (relates to #11).

  • Move WpsPackage properties to instance level to avoid potential referencing of attributes across same class used by distinct running Process.

4.18.0 (2022-06-09)

Changes:
  • Add CLI Authentication Handler parameters and corresponding auth argument of instantiated classes for WeaverClient methods that allows inline request authentication and authorization resolution to access a protected service. Any Authentication Handler implementation can be used to fulfill required server functionalities.

  • Add CLI handling of uncaught exceptions to gracefully report message and error instead of exception traceback.

  • Replaced CLI option -t by -T (Docker token) during deploy operation to match naming convention of other options (resolves #400).

  • Replaced CLI option -H by nH (--no-headers) and wH (--with-headers) to respectively enable or (explicitly) disable return of headers from response of the executed operation.

  • Replaced CLI option -L by nL (--no-links) and wL (--with-links) to respectively enable (explicitly) or disable return of links from response of the executed operation.

  • Replaced previously defined -H option by new -H/--header argument allowing insertion of explicitly provided request headers for relevant requests called by the executed operation.

  • Add case insensitive support of values for common API, CLI, and WeaverClient parameter choices.

  • Add all missing CLI and WeaverClient examples in the documentation.

Fixes:
  • Fix Process.payload improperly encoded in case of special characters where allowed such as in CWL definition.

  • Fix CLI operations assuming valid JSON response to instead return error response content and status code.

  • Fix CLI rendering of various optional arguments and groups when displaying help messages.

  • Fix invalid handling of Constants definitions mixed with classproperty such as in OutputFormat causing returned value to be the classproperty itself instead of the retrieved value from its getter definition.

  • Fix minor typing definitions that were incorrect.

4.17.0 (2022-05-30)

Changes:
  • Add statistics collection at the end of Job execution to obtain used memory from celery process and spaced used by produced results.

  • Add /jobs/{jobID}/statistics endpoint (and corresponding locations for /providers and /processes) to report any collected statistics following a Job execution.

Fixes:
  • Fix Job Location header injected twice in get_job_submission_response causing header to have comma-separated list of URI values failing retrieval by CLI when attempting to perform auto-monitoring of the submitted Job.

  • Fix CWL runtime context setup to return monitored maximum RAM used by application under the Process if possible.

  • Fix failing Service provider summary response in case of unresponsive (not accessible or parsable) URL endpoint contents due to different errors raised by distinct versions of requests package.

4.16.1 (2022-05-12)

Changes:
  • Add OpenGIS as a potential namespace resolver for common geospatial Media-Types such as image/tiff; subtype=geotiff that must be distinguished from generic IANA formats.

Fixes:
  • Fix invalid interpretation of stored Process I/O with schema with Media-Type reference not representing a pre-resolved OpenAPI schema object, but rather an expected URI contentSchema reference for default format.

  • Fix CLI combination of user-provided Process description and inserted Process ID by option argument considering alternative OGC/OLD representations.

  • Fix OAS format field dropped for literal type when resolving schema provided during Process deployment.

  • Fix Media-Type resolution dropping important sub-type parameters to distinguish between specific type context (e.g. image/tiff vs image/tiff; subtype=geotiff).

4.16.0 (2022-05-11)

Changes:
  • Add support of OpenAPI schema field for I/O definitions within Process description responses as required by OGC API - Processes specification (resolves #245). Existing and deployed processes using legacy I/O definitions will be parsed for corresponding fields employed in OpenAPI to generate the missing schema field. Inversely, processes directly deployed with schema definitions are ported back to legacy I/O representation by padding them with corresponding fields. Conversion between the two representations is unidirectional according to whether schema is specified or not. Nevertheless, the final I/O definitions can try to make use of both representations simultaneously and in combination with I/O definitions extracted from the CWL Application Package to resolve additional details during I/O merging strategy.

  • Add support of Accept header, f and format request queries for GET /jobs/{jobID}/logs retrieval using text, json, yaml and xml (and their corresponding Media-Type definitions) to list Job logs.

  • Add partial support of literals with unit of measure (UoM) specified during Process deployment using the I/O schema field (relates to #430).

  • Add partial support of bounding box parsing specified during Process deployment using the I/O schema field (relates to #51).

  • Add encoding/decoding of JSON I/O definitions for saving to database in order to support OpenAPI schema that can contain conflicting key names with MongoDB functionalities (e.g.: $ref).

  • Add parsing of CLI inputs with @parameter=value additional properties to be passed for the Process execution. This can be used for specifying the mediaType and encoding of a File reference input.

  • Remove deploymentProfileName requirement during Process deployment. The corresponding deploymentProfile property is instead automatically generated from resolved CWL package/reference or remote WPS reference. This further simplifies deployment using the CLI to its bare minimum components as only the CWL or WPS reference needs to be provided along the desired Process ID without any further details.

Fixes:
  • Remove VaultReference from ReferenceURL schema employed to reference external resources that are not intended to be used with temporary Vault definitions. Only inputs for Process execution will allow Vault references.

  • Fix LiteralOutput creation not removing allowed_values not available with PyWPS class.

  • Fix failing Process deployment caused by links if explicitly specified in the payload by the user. Additional links that don’t conflict with dynamically generated ones are added to the deployed Process definition.

  • Fix missing deploymentProfile property in Process description (resolves #319).

4.15.0 (2022-04-20)

Important:
  • In order to support synchronous execution, setting RESULT_BACKEND MUST be specified in the weaver.ini configuration file. See Weaver INI Configuration Example in section [celery] for more details.

  • With resolution and added support of transmissionMode handling according to OGC API - Processes specification, requests that where submitted with reference outputs will produce results in a different format than previously since this parameter was ignored and always returned value representation.

  • Due to celery>=5.2 migration, any call to celery CLI must be updated accordingly by moving the global options before the mode, namely worker, inspect and so on. Specifically for Weaver, this means the weaver-worker command line option -A must be moved before worker as follows:

    celery -A pyramid_celery.celery_app worker -B -E --ini weaver.ini [...]
    
Changes:
  • Support Prefer header with wait or respond-async directives to select Job execution mode either as synchronous or asynchronous task, according to supported jobControlOptions of the relevant Process being executed (resolves #247).

  • Increase minor version of all builtin processes that will now be executable in wither (a)synchronous modes.

  • Add weaver.exec_sync_max_wait and weaver.quote_sync_max_wait settings allowing custom definition for the maximum duration that can be specified to wait for a synchronous response from task workers.

  • Add -B (celery beat) option to Docker command of weaver-worker to run scheduled task in parallel to celery worker in order to periodically cleanup task results introduced by synchronous execution.

  • Add support of transmissionMode handling as reference to generate HTTP Link references for results requested this way (resolves #377).

  • Updated every Process to report that they support outputTransmission both as reference and value, since handling of results is accomplished by Weaver itself, regardless of the application being executed.

  • Add partial support of response=raw parameter for execution request submission in order to handle results to be returned accordingly to specified outputTransmission by reference or value. Multipart contents for multi-output results are not yet supported (relates to #376).

  • Add CLI option -R/--ref/--reference for execute operation allowing to request corresponding outputs by ID to be returned using the transmissionMode: reference method, producing HTTP Link headers for those entries rather than inserting values in the response content body.

  • Add requested outputs into response of GET /jobs/{jobId}/inputs to obtain submitted Job definitions.

  • Add query parameter schema for GET /jobs/{jobId}/inputs (and corresponding endpoints under /processes and /providers) allowing to retrieve submitted input values and requested outputs with either OGC/OLD formats.

  • Improve conformance for returned status codes and error messages when requesting results for an unfinished, failed, or dismissed Job.

  • Adjust conformance item references to correspond with OGC API - Processes: Part 2 renamed from Transactions to Deploy, Replace, Undeploy.

  • Add mutable field to Process summary listing and detailed descriptions for conformance (resolves #180).

  • Improve Process undeployment to consider running Job to block its removal while in use.

  • Add category query parameter to /conformance endpoint allowing to filter items by conf (conformance), rec (recommendation), req (requirement), per (permission) or all references. By default, return the conf representation which is the expected definitions by OGC API conformance validators.

  • Add multiple conformance items related to CWL and OGC Best Practice for Earth Observation Application Package definitions (relates to #56, #103, #105, #294, #399).

  • Phase out Python 3.6 support to better resolve package dependencies (could still work, but not explicitly supported nor officially guaranteed to work).

Fixes:
  • Fix outputs permitted to be completely omitted from the execution request (resolves #375).

  • Fix outputs permitted as explicit empty mapping or list as equivalent to omitting them, defining by default that all outputs should be returned with transmissionMode: value for Job execution.

  • Fix all instances of outputTransmission reported as reference in Process descriptions, although Weaver behaved with the value method, which is to return values and file references in content body, instead of HTTP Link header references.

  • Fix WPS 1/2 endpoint not reporting the appropriate instance URL (fixes #83).

  • Fix CLI deploy operation headers incorrectly passed down to the deployment request.

  • Fix many linting issues with latest pylint definitions.

  • Fix temporary pywps patches that have been integrated (relates to #352 addressing issues geopython/pywps#578 and geopython/pywps#623).

  • Fix celery security vulnerability with update to latest recommended version (resolves #386).

4.14.0 (2022-03-14)

Changes:
  • Add CLI option -L/--no-links that drops the links section of any response to make the printed result more concise and specific to relevant details of the called operation.

  • Add CLI option -F/--format that allows output of contents in an alternative format. Available formatters include JSON, YAML and XML representations, with either pretty indentation and newlines or not. This allows CLI calls that can return contents in the preferred format of a such that might need to parse the relevant details. Alternative until the API itself can return similar formatted responses (relates to #125).

  • Add CLI option -H/--headers that allows output of response headers as well as the response contents. This can be useful for endpoints that can return critical information, such as Location header for the Job status endpoint of an OGC compliant service, or the Preference-Applied header for services that support multiple execution modes (i.e.: wait for sync-execute or respond-async for async-execute control options).

  • Add CLI operation jobs to obtain listing with some options similar to the corresponding API endpoint queries.

Fixes:
  • No change.

4.13.0 (2022-03-09)

Changes:
  • Add schema query parameter to GET /jobs/{jobID}/outputs request allowing to select between OGC, OLD OGC+strict and OLD+strict representations (case insensitive), each with different combinations of format.mimeType, format.mediaType and/or directly type field to provide the Content-Type of an output with href file. By default, both the format (i.e.: OLD schema) and the type (i.e.: OGC schema) are simultaneously reported for backward and forward compatibility, and for OGC compliance, to return the IANA Media-Type of the associated file reference (relates to #401).

  • Add support of type as alias to the Media-Type under the format for file references when submitted for Job execution inputs, in accordance to the reported inputs/outputs endpoints, and for OGC compliance (resolves #401).

  • Drop type field for metadata items in process description that correspond to a value with a role.

  • Enforce pattern validation of type as IANA Content-Type for metadata items in process description that correspond to a Link with href. Invalid type are now rejected to adhere to OGC requirement classes.

  • Clarify schema employed by Weaver to use naming that is as close as possible to OGC schemas to facilitate their comprehension and external references.

Fixes:
  • Fix GET /jobs/{jobID}/inputs endpoint failing to return submitted inputs for Job execution when they were specified using the mapping representation (i.e.: OGC schema) instead of the listing representation (i.e.: OLD schema).

  • Fix Media-Type provided as Job file reference input not forwarded to underlying WPS execution for validation against supported formats for corresponding inputs. Specified format handles both the OLD definition with format field (and nested mimeType or mediaType), and the more recent OGC format with type field.

4.12.0 (2022-02-28)

Changes:
  • Updates related to OGC API - Processes: Quotation Extension.

  • Move estimator portion of the quoting operation into separate files and bind them with Celery task to allow the same kind of dispatched processing as normal Process execution.

  • Update Quote data type to contain status similarly to Job considering dispatched async processing.

  • Define LocalizedDateTimeProperty for reuse by data types avoiding issues about handling datetime localization.

  • Update OpenAPI schemas regarding Quote (partial/complete) and other datetime related fields.

  • Add parsing of Prefer header allowing sync processing (relates to #247). This is not yet integrated for Jobs execution themselves on processes/{id}/execution endpoint.

Fixes:
  • No change.

4.11.0 (2022-02-24)

Changes:
  • Support Process deployment using OGC schema (i.e.: Process metadata can be provided directly under processDescription instead of being nested under processDescription.process). This aligns the deployment schema with reference OGC API - Processes: Deploy, Replace, Undeploy extension (see OGC Application Package schema). The previous schema for deployment with nested process field remains supported for backward compatibility.

Fixes:
  • Fix resolution of the default field specifier under a list of supported formats during deployment. For various combinations such as when default: True format is omitted, or when the default is not ordered first, resolved default specifically for outputs definitions would be incorrect.

4.10.0 (2022-02-22)

Changes:
  • Refactor all constants of similar concept into classes to facilitate reuse and avoid omitting entries when iterating over all members of a corresponding constant group (fixes #33).

Fixes:
  • Fix resolution of common IANA Media-Types (e.g.: text/plain, image/jpeg, etc.) that technically do not provide and explicit entry when accessing the namespace (i.e.: {IANA_NAMESPACE_URL}/{mediaType}), but are known in IANA registry through various RFC specifications. The missing endpoints caused many recurring and unnecessary HTTP 404 that needed a second validation against EDAM namespace each time. These common Media-Types, along with new definitions in weaver.formats, will immediately return a IANA/EDAM references without explicit validation on their registries.

4.9.1 (2022-02-21)

Changes:
  • Add encryption of stored Vault file contents until retrieved for usage by the executed Process application.

Fixes:
  • Fix auto-resolution of Vault file Content-Type when not explicitly provided.

4.9.0 (2022-02-17)

Changes:
  • Add Vault endpoints providing a secured self-hosted file storage to upload local files for execution input.

  • Add upload CLI operation for uploading local files to Vault.

  • Add CLI automatic detection of local files during execute call to upload to Vault and retrieve them from it on the remote Weaver instance.

  • Add -S/--schema option to CLI describe operation.

  • Add more documentation examples and references related to CLI and WeaverClient usage.

  • Improve Media-Type/Content-Type guesses based on known local definitions and extensions in weaver.formats.

  • Extend PyWPS WPSRequest to support more authorization header forwarding for inputs that could need it.

Fixes:
  • Fix rendering of CLI required arguments under the appropriate argument group section when those arguments can be specified using prefixed - and -- optional arguments format.

  • Fix CLI url parameter to be provided using -u or --url without specific argument position needed.

  • Fix CLI parsing of File inputs for execute operation when provided with quotes to capture full paths.

  • Fix rendering of OpenAPI variable names (additionalParameters) employed to represent for example {input-id} as the key within the mapping representation of inputs/outputs. The previous notation employed was incorrectly interpreted as HTML tags, making them partially hidden in Swagger UI.

  • Fix reload of DockerAuthentication reference from database failing due to mismatched parameter names.

  • Fix invalid generation and interpretation of timezone-aware datetime between local objects and loaded from database. Jobs created or reported without any timezone UTC offset were assumed as UTC+00:00 although corresponding datetimes were generated based on the local machine timezone information. Once reloaded from database, the missing timezone awareness made datetime stored in ISO-8601 format to be interpreted as already localized datetime.

  • Fix invalid setup of generic CLI options headers for other operations than dismiss.

  • Fix weaver.request-options handling that always ignored timeout and verify entries from the configuration file by overriding them with default values.

4.8.0 (2022-01-11)

Changes:
  • Refactor Workflow operation flow to reuse shared input and output staging operations between implementations. Each new step process implementation now only requires to implement the specific operations related to deployment, execution, monitoring and result retrieval for their process, without need to consider Workflow intermediate staging operations to transfer files between steps.

  • Refactor Wps1Process and Wps3Process step processes to follow new workflow operation flow.

  • Add builtin process file_index_selector that allows the selection of a specific file within an array of files.

  • Add tests to validate chaining of Workflow steps using different combinations of process types including WPS-1, OGC-API and builtin implementations.

  • Move CWL script examples in documentation to separate package files in order to directly reference them in tests validating their deployment and execution requests.

  • Move all tests/functional/application-packages definitions into distinct directories to facilitate categorization of corresponding deployment, execution and package contents, and better support the various Workflow testing location of those files with backward compatibility.

  • Add logs final entry after retrieved internal CWL application logs to help highlight delimitation with following entries from the parent Process.

Fixes:
  • Fix handling of CWL Workflow outputs between steps when nested glob output binding are employed (resolves #371).

  • Fix resolution of builtin process Python reference when executed locally within a Workflow step.

  • Fix resolution of process type WPS-1 from its package within a Workflow step executed as OGC-API process.

  • Fix resolution of WPS1Requirement directly provided as CWL execution unit within the deployment body.

  • Fix deployment body partially dropping invalid executionUnit sub-fields causing potential misinterpretation of the intended application package.

  • Fix resolution of package or WPS-1 reference provided by href with erroneous Content-Type reported by the returned response. Attempts auto-resolution of detected CWL (as JSON or YAML) and WPS-1 (as XML) contents.

  • Fix resolution of format reference within CWL I/O record after interpretation of the loaded application package.

  • Fix missing WPS endpoint responses in generated OpenAPI for ReadTheDocs documentation.

  • Fix reporting of WPS-1 status location as the XML file URL instead of the JSON OGC-API endpoint when Job was originally submitted through the WPS-1 interface.

  • Fix and improve multiple typing definitions.

4.7.0 (2021-12-21)

Changes:
  • Add CLI --body and --cwl arguments support of literal JSON string for deploy operation.

Fixes:
  • Fix help message of CLI arguments not properly grouped within intended sections.

  • Fix handling of mutually exclusive CLI arguments in distinct operation sub-parsers.

  • Fix CLI requirement of --process and --job arguments.

4.6.0 (2021-12-15)

Changes:
  • Add WeaverClient and weaver CLI as new utilities to interact with Weaver instead of using the HTTP API. This provides both shell and Python script interfaces to run operations toward Weaver instances (or any other OGC API - Processes compliant instance except for deployment operations). It also facilitates new Process deployments by helping with the integration of a local CWL file into a full-fledged Deploy HTTP request, and other recurrent tasks such as Execute requests followed by Job monitoring and results retrieval once completed successfully (resolves #363, resolves DAC-198, relates to DAC-203).

  • Added weaver command installation to setup.py script.

  • Added auto-documentation utilities for new weaver CLI (argparse parameter definitions) and provide relevant references in new chapter in Sphinx documentation.

  • Added cwl2json_input_values function to help converting between CWL parameters and OGC API - Processes input value definitions for Job submission.

  • Added weaver.datatype.AutoBase that allows quick definition of data containers with fields accessible both as properties and dictionary keys, simply by detecting predefined class attributes, avoiding a lot of boilerplate code.

  • Split multiple file loading, remote validation and resolution procedures into distinct functions in order for the new CLI to make use of the same methodologies as needed.

  • Updated documentation with new details relevant to the added CLI and corresponding references.

  • Updated some tests utilities to facilitate definitions of new tests for WeaverClient feature validation.

  • Replaced literal string "OGC" and "OLD" used for schema selection by properly defined constants.

  • Add database revision number for traceability of migration procedures as needed.

  • Add first database revision with conversion of UUID-like strings to literal UUID objects.

  • Add links to /processes and /providers/{id}/processes listings (resolves #269).

  • Add limit, page and sort query parameters for /processes listing (resolves #269).

  • Add ignore parameter to /processes listing when combined with providers=true to allow the similar behaviour supported by ignore on /providers endpoint, to effectively ignore services that cause parsing errors or failure to retrieve details from the remote reference.

  • Add schema validation of contents returned on /processes endpoint.

  • Add more validation of paging applicable index ranges and produce HTTPBadRequest [400] when values are invalid.

Fixes:
  • Fix some typing definitions related to CWL function parameters.

  • Fix multiple typing inconsistencies or ambiguities between AnyValue (as Python typing for any literal value) against the actual class AnyValue of PyWPS. Typing definitions now all use AnyValueType instead.

  • Fix resolution of owsContext location in the payload of remote Process provided by href link in the executionUnit due to OGC API - Processes ("OGC" schema) not nested under process key (in contrast to "OLD" schema).

  • Fix resolution of outputs submitted as mapping (OGC API - Processes schema) during Job execution to provide desired filtered outputs in results and their transmissionMode. Note that filtering and handling of all transmissionMode variants are themselves not yet supported (relates to #377 and #380).

  • Fix resolution of unspecified UUID representation format in MongoDB.

  • Fix conformance with error type reporting of missing Job or Process (resolves #320).

  • Fix sorting of text fields using alphabetical case-insensitive ordering.

  • Fix search with paging reporting invalid total when out of range.

  • Pin pymongo<4 until celery>=5 gets resolved (relates to #386).

4.5.0 (2021-11-25)

Changes:
  • Add support of X-Auth-Docker request header that can be specified during Process deployment as authentication token that Weaver can use to obtain access and retrieve the Docker image referenced by the Application Package (CWL) located on a private registry.

  • Add more documentation details about sample CWL definitions to execute script, Python and Dockerized applications.

Fixes:
  • Fix parsing of inputs for OpenSearch parameters lookup that was assuming inputs were always provided as listing definition, not considering possible mapping definition.

  • Fix incorrect documentation section Package as External Execution Unit Reference where content was omitted and incorrectly anchored as following ESGF-CWT section.

4.4.0 (2021-11-19)

Changes:
  • Add map_wps_output_location utility function to handle recurrent mapping of weaver.wps_output_dir back and forth with resolved weaver.wps_output_url.

  • Add more detection of map-able WPS output location to avoid fetching files unnecessarily. Common cases are Workflow running multiple steps on the same server or Application Package Process that reuses an output produced by a previous execution. Relates to #183.

  • Add pre-validation of file accessibility using HTTP HEAD request when a subsequent Workflow step employs an automatically mapped WPS output location from a previous step to verify that the file would otherwise be downloadable if it could not have been mapped. This is to ensure consistency and security validation of the reference WPS output location, although the unnecessary file download operation can be avoided.

  • Add functional Workflow tests to validate execution without the need of remote Weaver test application (relates to #141, relates to #281).

  • Add missing documentation details about Data Source and connect chapters with other relevant documentation details and updated Workflow tests.

  • Add handling of Content-Disposition header providing preferred filename or filename* parameters when fetching file references instead of the last URL fragment employed by default (resolves #364).

  • Add more security validation of the obtained file name from HTTP reference, whether generated from URL path fragment or other header specification.

Fixes:
  • Fix incorrect resolution of Process results endpoint to pass contents from one step to another during Workflow execution (resolves #358).

  • Fix logic of remotely and locally executed applications based on CWL requirements when attempting to resolve whether an input file reference should be fetched.

  • Fix resolution of WPS I/O provided as mapping instead of listing during deployment in order to properly parse them and merge their metadata with corresponding CWL I/O definitions.

  • Fix DataSource and OpenSearch typing definitions to more rapidly detect incorrect data structures during parsing.

4.3.0 (2021-11-16)

Changes:
  • Add support of type and processID query parameters for Job listing (resolves some tasks in #268).

  • Add type field to Job status information (resolves #351).

  • Add OGC API - Processes conformance references regarding supported operations for Job listing and filtering.

  • Add minDuration and maxDuration parameters to query Job listing filtered by specific execution time range (resolves #268). Range duration parameters are limited to single values each (relates to opengeospatial/ogcapi-processes#261).

  • Require minimally pymongo==3.12.0 and corresponding MongoDB 5.0 instance to process new filtering queries of minDuration and maxDuration. Please refer to Database Migration and MongoDB official documentation for migration methods.

  • Refactor Job search method to facilitate its extension in the event of future filter parameters.

  • Support contextual WPS output location using X-WPS-Output-Context header to store Job results. When a Job is executed by providing this header with a sub-directory, the resulting outputs of the Job will be placed and reported under the corresponding location relative to WPS outputs (path and URL).

  • Add weaver.wps_output_context setting as default contextual WPS output location when header is omitted.

  • Replace Job.execute_async getter/setter by simple property using more generic Job.execution_mode for storage in database. Provide Job.execute_async and Job.execute_sync properties based on stored mode.

  • Simplify execute_process function executed by Celery task into sub-step functions where applicable.

  • Simplify forwarding of Job parameters between PyWPS service WorkerService.execute_job method and Celery task instantiating it by reusing the Job object.

  • Provide corresponding Job log URL along already reported log file path to facilitate retrieval from server side.

  • Avoid Job.progress updates following failed or dismissed statuses to keep track of the last real progress percentage that was reached when that status was set.

  • Improve typing of database and store getter functions to infer correct types and facilitate code auto-complete.

  • Implement Job dismiss operation ensuring pending or running tasks are removed and output result artifacts are removed from disk.

  • Implement HTTP Gone (410) status from already dismissed Job when requested again or when fetching its artifacts.

Fixes:
  • Removes the need for specific configuration to handle public/private output directory settings using provided X-WPS-Output-Context header (fixes #110).

  • Fix retrieval of Pyramid Registry and application settings when available container is Werkzeug Request instead of Pyramid Request, as employed by underlying HTTP requests in PyWPS service.

  • Allow group query parameter to handle Job category listing with provider as service alias.

  • Improve typing of database and store getter functions to infer correct types and facilitate code auto-complete.

  • Fix incorrectly configured API views for batch Job dismiss operation with DELETE /jobs and corresponding endpoints for Process and Provider paths.

  • Fix invalid Job links sometimes containing duplicate / occurrences.

  • Fix invalid Job link URL for alternate relationship.

4.2.1 (2021-10-20)

Changes:
  • Add more frequent Job updates of execution checkpoint pushed to database in order to avoid inconsistent statuses between the parent Celery task and the underlying Application Package being executed, since both can update the same Job entry at different moments.

  • Add a Job log entry as "accepted" on the API side before calling the Celery task submission (Job not yet picked by a worker) in order to provide more detail between the submission time and initial execution time. This allows to have the first log entry not immediately set to "running" since both "started" and "running" statues are remapped to "running" within the task to be compliant with OGC status codes.

Fixes:
  • Fix an inconsistency between the final Job status and the reported “completed” message in logs due to missing push of a newer state prior re-fetch of the latest Job from the database.

4.2.0 (2021-10-19)

Changes:
  • Add execution endpoint POST /provider/{id}/process/{id}/execution corresponding to the OGC-API compliant endpoint for local Process definitions.

  • Add multiple additional relation links for Process and Job responses (resolves #234 and #267).

  • Add convenience DELETE /jobs endpoint with input list of Job UUIDs in order to dismiss multiple entries simultaneously. This is useful for quickly removing a set of Job returned by filtered GET /jobs contents.

  • Update conformance link list for dismiss and relevant relation links definitions (relates to #53 and #267).

  • Add better support and reporting of Job status dismissed when operation is called from API on running task.

  • Use explicit started status when Job has been picked up by a Celery worker instead of leaving it to accepted (same status that indicates the Job “pending”, although a worker is processing it). Early modification of status is done in case setup operations (send WPS request, prepare files, etc.) take some time which would leave users under the impression the Job is not getting picked up. Report explicit running status in Job once it has been sent to the remote WPS endpoint. The API will report running in both cases in order to support OGC API - Processes naming conventions, but internal Job status will have more detail.

  • Add updated timestamp to Job response to better track latest milestones saved to database (resolves #249). This avoids users having to compare many fields (created, started, finished) depending on latest status.

  • Apply stricter Deploy body schema validation and employ deserialized result directly. This ensures that preserved fields in the submitted content for deployment contain only known data elements with expected structures for respective schemas. Existing deployment body that contain invalid formats could start to fail or might generate inconsistent Process descriptions if not adjusted.

  • Add improved reporting of erroneous inputs during Process deployment whenever possible to identify the cause.

  • Add more documentation details about missing features such as EOImage inputs handled by OpenSearch requests.

  • Add weaver.celery flag to internal application settings when auto-detecting that current runner is celery. This bypasses redundant API-only operations during application setup and startup not needed by celery worker.

Fixes:
  • Fix OGC-API compliant execution endpoint POST /process/{id}/execution not registered in API.

  • Fix missing status for cancelled Jobs in order to properly support dismiss operation (resolves #145 and #228).

  • Fix all known OGC-specific link relationships with URI prefix (resolves #266).

  • Fix incorrect rendering of some table cells in the documentation.

4.1.2 (2021-10-13)

Changes:
  • No change.

Fixes:
  • Add celery worker task events flag (-E) to Docker command (weaver-worker) to help detect submitted delayed tasks when requesting job executions.

4.1.1 (2021-10-12)

Changes:
  • No change.

Fixes:
  • Fix handling of default format field of WPS input definition incorrectly resolved as default data by PyWPS for Process that allows optional (minOccurs=0) inputs of Complex type. Specific case is detected with relevant erroneous data and dropped silently because it should not be present (since omitted in WPS request) and should not generate a WPS input (relates to geopython/pywps#633).

  • Fix resolution of CWL field default value erroneously inserted as "null" literal string for inputs generated from WPS definition to avoid potential confusion with valid "null" input or default string. Default behaviour to drop or ignore omitted inputs are handled by "null" within type field in CWL definitions.

  • Fix Wps1Process job runner for dispatched execution of WPS-1 Process assuming all provided inputs contain data or reference. Skip omitted optional inputs that are resolved with None value following above fixes.

  • Resolve execution failure of WPS-1 Process ncdump under hummingbird Provider (fixes issue identified in output logs from notebook in PR pavics-sdi#230).

4.1.0 (2021-09-29)

Changes:
  • Improve reporting of mismatching Weaver configuration for Process and Application Package definitions that always require remote execution. Invalid combinations will be raised during execution with detailed problem.

  • Forbid Provider and applicable Process definitions to be deployed, executed or queried when corresponding remote execution is not supported according to Weaver instance configuration since Provider must be accessed remotely.

  • Refactor endpoint views and utilities referring to Provider operations into appropriate modules.

  • Apply weaver.configuration = HYBRID by default in example INI configuration since it is the most common use case. Apply same configuration by default in tests. Default resolution still employs DEFAULT for backward compatibility in case the setting was omitted completely from a custom INI file.

  • Add query parameter ignore to GET /providers listing in order to obtain full validation of remote providers (including XML contents parsing) to return 200. Invalid definitions will raise and return a [422] Unprocessable Entity HTTP error.

  • Add more explicit messages about the problem that produced an error (XML parsing, unreachable WPS, etc.) and which caused request failure when attempting registration of a remote Provider.

Fixes:
  • Fix reported links by processes nested under a provider Service. Generated URL references were omitting the /providers/{id} portion.

  • Fix documentation referring to incorrect setting name in some cases for WPS outputs configuration.

  • Fix strict XML parsing failing resolution of some remote WPS providers with invalid characters such as <, <= within process description fields. Although invalid, those easily recoverable errors will be handled by the parser.

  • Fix resolution and execution of WPS-1 remote Provider and validate it against end-to-end test procedure from scratch Service registration down to results retrieval (fixes #340).

  • Fix resolution of applicable Provider listing schema validation when none have been registered (fixes #339).

  • Fix incorrect schema definition of Process items for GET /processes response that did not report the alternative identifier-only listing when detail=false query is employed.

  • Fix incorrect reporting of documented OpenAPI reference definitions for query parameters with same names shared across multiple endpoints. Fix is directly applied on relevant reference repository that generates OpenAPI schemas (see fmigneault/cornice.ext.swagger@70eb702).

  • Fix weaver.exception definitions such that raising them directly will employ the corresponding HTTPException code (if applicable) to generate the appropriate error response automatically when raising them directly without further handling. The order of class inheritance were always using 500 due to WeaverException definition.

4.0.0 (2021-09-21)

Changes:
  • Apply conformance updates to better align with expected ProcessDescription schema from OGC API - Processes v1.0-draft6. The principal change introduced in this case is that process description contents will be directly at the root of the object returned by /processes/{id} response instead of being nested under "process" field. Furthermore, inputs and outputs definitions are reported as mapping of {"<id>": {<parameters>}} as specified by OGC-API instead of old listing format [{"id": "<id-value>", <key:val parameters>}]. The old nested and listing format can still be obtained using request query parameter schema=OLD, and will otherwise use OGC-API by default or when schema=OGC. Note that some duplicated metadata fields are dropped regardless of selected format in favor of OGC-API names. Some examples are abstract that becomes description, processVersion that simply becomes version, mimeType that becomes mediaType, etc. Some of those changes are also reflected by ProcessSummary during listing of processes, as well as for corresponding provider-related endpoints (relates to #200).

  • Add backward compatibility support of some metadata fields (abstract, mimeType, etc.) for Deploy operation of pre-existing processes. When those fields are detected, they are converted inplace in favor of their corresponding new names aligned with OGC-API.

  • Update mimeType to mediaType as format type representation according to OGC-API (relates to #211).

  • Add explicit pattern validation (type/subtype) of format string definitions with MediaType schema.

  • Add sorting capability to generate mapping schemas for API responses using overrides of properties _sort_first and _sort_after using lists of desired ordered field names.

  • Improved naming of many ambiguous and repeated words across schema definitions that did not necessarily interact with each other although making use of similar naming convention, making their interpretation and debugging much more complicated. A stricter naming convention has been applied for consistent Deploy/Describe/Execute-related and Input/Output-related references.

  • Replace list_remote_processes function by method processes under the Service instance.

  • Replace get_capabilities function by reusing and extending method summary under the Service instance.

  • Improve generation of metadata and content validation of Service provider responses (relates to OGC #200 and #266).

  • Add query parameter detail to providers listing request to allow listing of names instead of their summary (similarly to the processes endpoint query parameter).

  • Add query parameter check to providers listing request to retrieve all registered Service regardless of their URL endpoint availability at the moment the request is executed (less metadata is retrieved in that case).

  • Add weaver.schema_url configuration parameter and weaver.wps_restapi.utils.get_schema_ref function to help generate $schema definition and return reference to expected/provided schema in responses (relates to #157) Only utilities are added, not all routes provide the information yet.

  • Add validation of schema field under Format schema (as per opengeospatial/ogcapi-processes schema format.yml) such that only URL formatted strings are allowed, or alternatively an explicit JSON definition. Previous definitions that would indicate an empty string schema are dropped since schema is optional.

  • Block unknown and builtin process types during deployment from the API (fixes #276). Type builtin can only be registered by Weaver itself at startup. Other unknown types that have no indication for mapping to an appropriate Process implementation are preemptively validated.

  • Add parsing and generation of additional literalDataDomains for specification of WPS I/O data constrains and provide corresponding definitions in process description responses (fixes #41, #211, #297).

  • Add additional maximumMegabyte metadata detail to formats of WPS I/O of complex type whenever available (requires geopython/OWSLib#796, future OWSLIB==0.26.0 release).

Fixes:
  • Revert an incorrectly removed schema deserialization operation during generation of the ProcessSummary employed for populating process listing.

  • Revert an incorrectly modified schema reference that erroneously replaced service provider ProcessSummary items during their listing by a single ProcessInputDescriptionSchema (introduced since 3.0.0).

  • Fix #203 with explicit validation test of ProcessSummary schema for providers response.

  • Fix failing minOccurs and maxOccurs generation from a remote provider Process to support OGC-API format (relates to #263).

  • Fix schemas references and apply deserialization to providers listing request.

  • Fix failing deserialization of variable children schema under mapping when this variable element is allowed to be undefined (i.e.: defined with missing=drop). Allows support of empty inputs mapping of OGC-API representation of ProcessDescription that permits such processes (constant or random output generator).

  • Fix some invalid definitions of execution inputs schemas under mapping with value sub-schema where key-based input IDs (using additionalProperties) where replaced by the variable <input-id> name instead of their original names in the request body (from #265 since 3.4.0).

  • Fix parsing error raised from wps_processes.yml configuration file when it can be found but contains neither a processes nor providers section. Also, apply more validation of specified name values.

  • Fix parsing of request_extra function/setting parameters for specifically zero values corresponding to retries and backoff options that were be ignored.

  • Fix incorrect parsing of default field within WPS input when literal data type is present and was assumed as complex (fixes #297).

  • Fix and test various invalid schema deserialization validation issues, notably regarding PermissiveMappingSchema, schema nodes ExtendedFloat, ExtendedInt and their handling strategies when combined in mappings or keywords.

  • Fix resolution of similar values that could be implicitly converted between ExtendedString, ExtendedFloat, ExtendedInt and ExtendedBool schema types to guarantee original data type explicitly defined are preserved.

  • Fix runningSeconds field reporting to be of float type although implicit int type conversion could occur.

  • Fix validation of Execute inputs schemas to adequately distinguish between optional inputs and incorrect formats.

  • Fix resolution of Accept-Language negotiation forwarded to local or remote WPS process execution.

  • Fix XML security issue flagged within dependencies to PyWPS and OWSLib by pinning requirements to versions pywps==4.5.0 and owslib==0.25.0, and apply the same fix in Weaver code (see following for details: geopython/pywps#616, geopython/pywps#618, geopython/pywps#624, CVE-2021-39371).

3.5.0 (2021-08-19)

Changes:
  • No change.

Fixes:
  • Fix weaver.datatype objects auto-resolution of fields using either attributes (accessed as dict) or properties (accessed as class) to ensure correct handling of additional operations on them.

  • Fix DuplicateKeyError that could sporadically arise during initial processes storage creation when builtin processes get inserted/updated on launch by parallel worker/threads running the application. Operation is relaxed only for default builtin to allow equivalent process replacement (upsert) instead of only explicit inserts, as they should be pre-validated for duplicate entries, and only new definitions should be registered during this operation (fixes #246).

3.4.0 (2021-08-11)

Changes:
  • Add missing processID detail in job status info response (relates to #270).

  • Add support for inputs under mapping for inline values and arrays in process execution (relates to #265).

Fixes:
  • Fix copy of headers when generating the WPS clients created for listing providers capabilities and processes.

3.3.0 (2021-07-16)

Changes:
  • Add support for array type as job inputs (relates to #233).

  • Remove automatic conversion of falsy/truthy string and integer type definitions to boolean type to align with OpenAPI boolean type definitions. Non explicit boolean values will not be automatically converted to bool anymore. They will require explicit false|true values.

Fixes:
  • Fix minOccurs and maxOccurs representation according to OGC-API (fixes #263).

  • Fixed the format of the output file URL. When the prefix / was not present, URL was incorrectly handled by not prepending the required base URL location.

3.2.1 (2021-06-08)

Changes:
  • No change.

Fixes:
  • Fix backward compatibility of pre-deployed processes that did not define jobControlOptions that is now required. Missing definition are substituted in-place by default ["execute-async"] mode.

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 geopython/pywps#602 (specifically commit 343d825), which broke the ComplexInput work-around to avoid useless of file URLs (see issue geopython/pywps#526).

  • Fix default execution mode specification in process job control options (fixes opengeospatial/ogcapi-processes#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 geopython/pywps#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.

See also

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.

Problem connecting workflow steps together

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).

Where can I find examples of Process Deployment, Execution and Application Package definitions?

Many examples are reported in detail in the Examples chapter.

Is there an easier way to interact with Weaver for its multiple requests and operations?

Yes!

Take a look at the Weaver CLI and Client chapter for available utilities to interact with Weaver using shell or Python scripting.

Glossary

ADES
Application Deployment and Execution Service
See Processes section for details. Alternative operation modes are described in Configuration Settings.
AOI
Area of Interest.
Corresponds to a region, often provided by OGC WKT definition, employed for OpenSearch queries in the context of EOImage inputs.
API
Application Programming Interface
Most typically, referring to the use of HTTP(S) requests following an OpenAPI specification.
Application Package

General term that refers to “what and how to execute” the Process. Application Packages provide the core details about the execution methodology of the underlying operation that defines the Process, and are therefore always contained within a Process Description. 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 the Application Package section for all relevant details.

AWS
Amazon Web Services
In the context of Weaver, most often referring specifically to the use of S3 buckets.
Bill
Billing

Result from Billing following Quote Estimation when enabled on the Weaver instance.

CLI
Command Line Interface
Script that offers interactions through shell commands or Python scripts to execute any described operations. Details of the provided Weaver commands are described in Weaver CLI and Client chapter.
CWL
Representation of the internal Application Package of the Process to provide execution methodology of the referenced Docker image or other supported definitions. A Common Workflow Language file can be represented both in JSON or YAML format, but is often represented in JSON in the context of Weaver for its easier inclusion within HTTP request contents. See Application Package section for further details.
Data Source

Known locations of remote servers where an ADES or EMS (either Weaver or other implementation) can accept Process deployment, or any other server supporting OGC API - Processes with pre-deployed Process, where executions can be dispatched according to the source of the data.

See also

Refer to Configuration of Data Sources and ADES dispatching using Data Sources sections for more 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 operation modes are described in Configuration Settings.
EOImage
Earth Observation Image
Input that interprets additional parameters in order to infer specific images applicable with filters following search results within a remote catalog.

See also

OpenSearch Data Source section.

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.
HYBRID
Combination of ADES and EMS operation modes.
See Processes section for details. Alternative operation modes are described in Configuration Settings.
I/O

Inputs and/or Outputs of CWL, OAP, WPS or OAS representation 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.
KVP
Key-Value Pairs
String representation of a set of key-value pairs, usually but not limited to, = character separating keys from their values, , for multi-value (array) definitions, and another separator such as & or ; to distinguish between distinct pairs. Specific separators, and any applicable escaping methods, depend on context, such as in URL query, HTTP header, CLI parameter, etc.
Media-Types
MIME-types
Multipurpose Internet Mail Extensions
Format representation of the referenced element, often represented by IANA or EDAM ontologies. More recent Media-Type naming is employed for the general use of Content-Type data representation in multiple situations and contexts.
OAP
OGC API - Processes

The new API that defines JSON REST-binding representation of WPS Process collection.

OAS
OpenAPI

OpenAPI Specification (OAS) defines a standard, programming language-agnostic interface description for HTTP APIs. It is used in Weaver and OGC API - Processes to represent API definitions for requests and responses, as well as I/O definitions for Process description.

OGC

Open Geospatial Consortium

ONNX

The Open Neural Network Exchange (ONNX) standard is an open format employed for sharing machine learning model representations with an agnostic approach across frameworks, tools, runtimes, and compilers.

OpenSearch

Protocol of lookup and retrieval of remotely stored files. Please refer to OpenSearch Data Source for details.

OWS
OGC Web Services
Family of services including WPS, defined prior to the family of OGC API standards.
Process

Entity that describes the required inputs, produced outputs, and any applicable metadata for the execution of the defined script, calculation, or operation.

Provider

Entity that offers an ensemble of Process under it. It is typically a reference to a remote service, where any Process it provides is fetched dynamically on demand.

Quote
Quotation

Result from Quote Estimation when enabled on the Weaver instance.

Quote Estimator
Quotation Estimator

A model that can provide cost estimations regarding the execution of a Process to form a term:Quote.

Request Options

Configuration settings that can be defined for Weaver in order to automatically insert additional HTTP request parameters, authentication or other any relevant rules when target URLs are matched. See also Configuration of Request Options.

S3

Simple Storage Service (AWS S3), bucket file storage.

TOI
Time of Interest
Corresponds to a date/time interval employed for OpenSearch queries in the context of EOImage inputs.
UoM
Unit of Measure
Represents a measurement defined as literal value associated with a specific unit that could take advantage of known conversion methods with other compatible units to obtain the equivalent value. These values are transferred to the Process as specified, and it is up to the underlying Application Package definition to interpret it as deemed fit.
URI
Uniform Resource Identifier
Superset of URL and URN that uses a specific string format to identify a resource.
URL
Uniform Resource Locator
Subset of URI that follows the <scheme>://<scheme-specific-part> format, as per RFC 1738. Specifies where an identified resource is available and the protocol mechanism employed for retrieving it. This is employed in Weaver for http(s)://, s3:// and file:// locations by I/O, or in general to refer to API locations.
URN
Uniform Resource Name
Subset of URI that follows the urn:<namespace>:<specific-part> format, as per RFC 8141. It is used to register a unique reference to a named entity such as a UoM or other common definitions.
Vault

Secured storage employed to upload files that should be temporarily stored on the Weaver server for later retrieval using an access token.

WKT

Well-Known Text geometry representation.

Workflow

A specific variant of Process where the execution consists of nested Process executions with input/output chaining between operations.

See also

Refer to Workflow, Workflow Step Operations and CWL Workflow sections for more details.

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.
WPS-REST

Alias employed to refer to OGC API - Processes endpoints for corresponding WPS definitions.

WPS-T

Alias employed to refer to older revisions of OGC API - Processes standard. The name referred to WPS Transactional operations introduced by the RESTful API.

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.
YAML
YAML Ain’t Markup Language
YAML is a human-friendly data serialization language for all programming languages. It is employed in Weaver as an alternative and equivalent representation of JSON format, mostly in cases where configuration files are defined to allow the insertion of additional documentation details.