weaver.datatype
¶
Module Contents¶
-
class
weaver.datatype.
Base
[source]¶ Dictionary with extended attributes auto-
getter
/setter
for convenience. Explicitly overriddengetter
/setter
attributes are called instead ofdict
-keyget
/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.
-
class
weaver.datatype.
Service
(*args, **kwargs)[source]¶ Dictionary that contains OWS services. It always has
url
key.Initialize self. See help(type(self)) for accurate signature.
-
class
weaver.datatype.
Job
(*args, **kwargs)[source]¶ Dictionary that contains OWS service jobs. It always has
id
andtask_id
keys.Initialize self. See help(type(self)) for accurate signature.
-
save_log
(self, errors: Optional[Union[AnyStr, List[WPSException]]] = None, logger: Optional[Logger] = None, message: Optional[AnyStr] = None, level: int = 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 toJob._get_log_msg()
and the format defined byget_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 iferrors
are logged.
Note
The job object is updated with the log but still requires to be pushed to database to actually persist it.
-
property
task_id
(self)[source]¶ Reference Task UUID attributed by the
Celery
worker that monitors and executes this job.
-
property
wps_id
(self)[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.
See also
-
-
class
weaver.datatype.
Process
(*args, **kwargs)[source]¶ Dictionary that contains a process description for db storage. It always has
identifier
andprocessEndpointWPS1
keys.Initialize self. See help(type(self)) for accurate signature.
-
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.
-
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.
-
static
from_wps
(wps_process: ProcessWPS, **extra_params: Any)[source]¶ Converts a PyWPS Process into a
weaver.datatype.Process
using provided parameters.
-
-
class
weaver.datatype.
Quote
(*args, **kwargs)[source]¶ Dictionary that contains quote information. It always has
id
andprocess
keys.Initialize self. See help(type(self)) for accurate signature.
-
class
weaver.datatype.
Bill
(*args, **kwargs)[source]¶ Dictionary that contains bill information. It always has
id
,user
,quote
andjob
keys.Initialize self. See help(type(self)) for accurate signature.