weaver.datatype

Definitions of types used by tokens.

Module Contents

weaver.datatype.LOGGER[source]
class weaver.datatype.Base[source]

Bases: dict

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.

id[source]
uuid[source]
json(self)[source]

Obtain the JSON data representation for response body.

Note

This method implementation should validate the JSON schema against the API definition whenever applicable to ensure integrity between the represented data type and the expected API response.

params(self)[source]

Obtain the internal data representation for storage.

Note

This method implementation should provide a JSON-serializable definition of all fields representing the object to store.

class weaver.datatype.Service(*args, **kwargs)[source]

Bases: weaver.datatype.Base

Dictionary that contains OWS services. It always has url key.

id[source]
url[source]

Service URL.

name[source]

Service name.

type[source]

Service type.

public[source]

Flag if service has public access.

auth[source]

public, token, cert.

Type:Authentication method
json(self)[source]
params(self)[source]
class weaver.datatype.Job(*args, **kwargs)[source]

Bases: weaver.datatype.Base

Dictionary that contains OWS service jobs. It always has id and task_id keys.

id[source]

Job UUID to retrieve the details from storage.

task_id[source]

Reference Task UUID attributed by the Celery worker that monitors and executes this job.

wps_id[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.

service[source]

Service identifier of the corresponding remote process.

See also

process[source]

Process identifier of the corresponding remote process.

See also

inputs[source]
user_id[source]
status[source]
status_message[source]
status_location[source]
notification_email[source]
accept_language[source]
execute_async[source]
is_workflow[source]
created[source]
finished[source]
duration[source]
duration_str[source]
progress[source]
results[source]
exceptions[source]
logs[source]
tags[source]
access[source]

Job visibility access from execution.

request[source]

XML request for WPS execution submission as string.

response[source]

XML status response from WPS execution submission as string.

_get_log_msg(self, msg=None)[source]
save_log(self, errors=None, logger=None, message=None, level=INFO)[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.

Note

The job object is updated with the log but still requires to be pushed to database to actually persist it.

_get_inputs(self)[source]
_set_inputs(self, inputs)[source]
is_finished(self)[source]
mark_finished(self)[source]
_get_results(self)[source]
_set_results(self, results)[source]
_get_exceptions(self)[source]
_set_exceptions(self, exceptions)[source]
_get_logs(self)[source]
_set_logs(self, logs)[source]
_get_tags(self)[source]
_set_tags(self, tags)[source]
_job_url(self, settings)[source]
json(self, container=None)[source]

Obtain the JSON data representation for response body.

Note

Settings are required to update API shortcut URLs to job additional information. Without them, paths will not include the API host, which will not resolve to full URI.

params(self)[source]
class weaver.datatype.Process(*args, **kwargs)[source]

Bases: weaver.datatype.Base

Dictionary that contains a process description for db storage. It always has identifier and processEndpointWPS1 keys.

id[source]
identifier[source]
title[source]
abstract[source]
keywords[source]
metadata[source]
version[source]
inputs[source]
outputs[source]
jobControlOptions[source]
outputTransmission[source]
processDescriptionURL[source]
processEndpointWPS1[source]
executeEndpoint[source]
owsContext[source]
type[source]
package[source]

Package CWL definition as JSON.

payload[source]

Deployment specification as JSON body.

_character_codes = [['$', '$'], ['.', '.']][source]
visibility[source]
params_wps[source]

Values applicable to PyWPS Process __init__

static _recursive_replace(pkg, index_from, index_to)[source]
static _encode(obj)[source]
static _decode(obj)[source]
params(self)[source]
json(self)[source]
process_offering(self)[source]
process_summary(self)[source]
static from_wps(wps_process, **extra_params)[source]

Converts a PyWPS Process into a weaver.datatype.Process using provided parameters.

wps(self)[source]
class weaver.datatype.Quote(*args, **kwargs)[source]

Bases: weaver.datatype.Base

Dictionary that contains quote information. It always has id and process keys.

id[source]

Quote ID.

title[source]

Quote title.

description[source]

Quote description.

details[source]

Quote details.

user[source]

User ID requesting the quote

process[source]

WPS Process ID.

estimatedTime[source]

Process estimated time.

processParameters[source]

Process execution parameters for quote.

location[source]

WPS Process URL.

price[source]

Price of the current quote

currency[source]

Currency of the quote price

expire[source]

Quote expiration datetime.

created[source]

Quote creation datetime.

steps[source]

Sub-quote IDs if applicable

params(self)[source]
json(self)[source]
class weaver.datatype.Bill(*args, **kwargs)[source]

Bases: weaver.datatype.Base

Dictionary that contains bill information. It always has id, user, quote and job keys.

id[source]

Bill ID.

user[source]

User ID

quote[source]

Quote ID.

job[source]

Job ID.

price[source]

Price of the current quote

currency[source]

Currency of the quote price

created[source]

Quote creation datetime.

title[source]

Quote title.

description[source]

Quote description.

params(self)[source]
json(self)[source]