weaver.wps.service¶
Module Contents¶
-
class
weaver.wps.service.ReferenceStatusLocationStorage(: str, url_location: weaver.typedefs.SettingsType, settings)[source]¶ Simple storage that simply redirects to a pre-existing status location.
-
url(self, *_, **__)[source]¶ - Parameters
destination – the name of the output to calculate the url for
- Returns
URL where file_name can be reached
-
location(self, *_, **__)[source]¶ Provides a location for the specified destination. This may be any path, pathlike object, db connection string, URL, etc and it is not guaranteed to be accessible on the local file system :param destination: the name of the output to calculate
the location for
- Returns
location where file_name can be found
-
store(self, *_, **__)[source]¶ - Parameters
output – of type IOHandler
- Returns
(type, store, url) where type - is type of STORE_TYPE - number store - string describing storage - file name, database connection url - url, where the data can be downloaded
-
write(self, *_, **__)[source]¶ - Parameters
data – data to write to storage
destination – identifies the destination to write to storage generally a file name which can be interpreted by the implemented Storage class in a manner of its choosing
data_format – Optional parameter of type pywps.inout.formats.FORMAT describing the format of the data to write.
- Returns
url where the data can be downloaded
-
-
class
weaver.wps.service.WorkerExecuteResponse(: pywps.app.WPSRequest, wps_request: str, uuid: pywps.app.Process, process: str, job_url: weaver.typedefs.SettingsType, settings: Any, *_: Any, **__)[source]¶ XML response generator from predefined job status URL and executed process definition.
constructor
- Parameters
wps_request (pywps.app.WPSRequest.WPSRequest) –
process (pywps.app.Process.Process) –
uuid – string this request uuid
-
class
weaver.wps.service.WorkerService(*_, is_worker=False, settings=None, **__)[source]¶ Dispatches PyWPS requests from WPS-1/2 XML endpoint to WPS-REST as appropriate.
Note
For every WPS-Request type, the parsing of XML content is already handled by the PyWPS service for GET/POST. All data must be retrieved from parsed
WPSRequestto avoid managing argument location and WPS versions.When
GetCapabilitiesorDescribeProcessrequests 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
Executerequest, convert the XML payload to corresponding JSON and dispatch it to the Celery Worker to actually process it after job setup for monitoring.-
_get_capabilities_redirect(self: pywps.app.WPSRequest, wps_request: Any, *_: Any, **__) → Optional[Union[WPSResponse, HTTPValid]][source]¶ Redirects to WPS-REST endpoint if requested
Content-Typeis JSON.
-
get_capabilities(self: pywps.app.WPSRequest, wps_request: Any, *_: Any, **__) → Union[WPSResponse, HTTPValid][source]¶ Redirect to WPS-REST endpoint if requested
Content-Typeis JSON or handleGetCapabilitiesnormally.
-
_describe_process_redirect(self: pywps.app.WPSRequest, wps_request: Any, *_: Any, **__) → Optional[Union[WPSResponse, HTTPValid]][source]¶ Redirects to WPS-REST endpoint if requested
Content-Typeis JSON.
-
describe(self: pywps.app.WPSRequest, wps_request: Any, *_: Any, **__) → Union[WPSResponse, HTTPValid][source]¶ Redirect to WPS-REST endpoint if requested
Content-Typeis JSON or handleDescribeProcessnormally.
-
_submit_job(self: pywps.app.WPSRequest, wps_request) → Union[WPSResponse, HTTPValid, JSON][source]¶ Dispatch operation to WPS-REST endpoint, which in turn should call back the real Celery Worker for execution.
-
prepare_process_for_execution(self: str, identifier) → pywps.app.Process[source]¶ Handles dispatched remote provider process preparation during execution request.
-
execute(self: str, identifier: pywps.app.WPSRequest, wps_request: str, uuid) → Union[WPSResponse, HTTPValid][source]¶ Submit WPS request to corresponding WPS-REST endpoint and convert back for requested
Acceptcontent-type.Overrides the original execute operation, that instead will get handled by
execute_job()following callback from Celery Worker that handles process job creation and monitoring.If
Acceptis JSON, the result is directly returned from_submit_job(). IfAcceptis XML or undefined,WorkerExecuteResponseconverts the received JSON with XML template.
-