weaver.status ============= .. py:module:: weaver.status Module Contents --------------- .. py:class:: StatusCompliant Utility :class:`enum.Enum` methods. Create an extended enum with these utilities as follows. .. code-block:: python class CustomEnum(ExtendedEnum): ItemA = "A" ItemB = "B" .. warning:: Must not define any enum value here to allow inheritance by subclasses. .. py:attribute:: OGC :value: 'OGC' .. py:attribute:: PYWPS :value: 'PYWPS' .. py:attribute:: OWSLIB :value: 'OWSLIB' .. py:attribute:: OPENEO :value: 'OPENEO' .. py:class:: StatusCategory Utility :class:`enum.Enum` methods. Create an extended enum with these utilities as follows. .. code-block:: python class CustomEnum(ExtendedEnum): ItemA = "A" ItemB = "B" .. warning:: Must not define any enum value here to allow inheritance by subclasses. .. py:attribute:: FINISHED :value: 'FINISHED' .. py:attribute:: RUNNING :value: 'RUNNING' .. py:attribute:: PENDING :value: 'PENDING' .. py:attribute:: FAILED :value: 'FAILED' .. py:attribute:: SUCCESS :value: 'SUCCESS' .. py:class:: Status Constants container that provides similar functionalities to :class:`ExtendedEnum` without explicit Enum membership. .. py:attribute:: CREATED :value: 'created' .. py:attribute:: QUEUED :value: 'queued' .. py:attribute:: ACCEPTED :value: 'accepted' .. py:attribute:: STARTED :value: 'started' .. py:attribute:: PAUSED :value: 'paused' .. py:attribute:: SUCCEEDED :value: 'succeeded' .. py:attribute:: SUCCESSFUL :value: 'successful' .. py:attribute:: FAILED :value: 'failed' .. py:attribute:: ERROR :value: 'error' .. py:attribute:: FINISHED :value: 'finished' .. py:attribute:: RUNNING :value: 'running' .. py:attribute:: CANCELED :value: 'canceled' .. py:attribute:: DISMISSED :value: 'dismissed' .. py:attribute:: EXCEPTION :value: 'exception' .. py:attribute:: UNKNOWN :value: 'unknown' .. py:data:: JOB_STATUS_CATEGORIES .. py:data:: JOB_STATUS_CODE_API .. py:data:: JOB_STATUS_SEARCH_API .. py:data:: STATUS_PYWPS_MAP .. py:data:: STATUS_PYWPS_IDS .. py:data:: StatusType :type: Status .. py:function:: map_status(wps_status: AnyStatusType) -> StatusType map_status(wps_status: AnyStatusType, compliant: StatusCompliant) -> StatusType map_status(wps_status: AnyStatusType, *, category: Any) -> StatusCategory Maps execution statuses between compatible values of different implementations. Mapping is supported for values from :mod:`weaver.status`, :mod:`OWSLib`, :mod:`pywps`, :term:`openEO`, as well as some specific one-of values of custom :term:`OAP` implementations. For each compliant combination, unsupported statuses are changed to corresponding ones with the closest logical match. Statuses are returned following :class:`Status` format. Specifically, this ensures statues are lowercase and not prefixed by ``Process`` (as in :term:`XML` response of :term:`OWS` :term:`WPS` like ``ProcessSucceeded`` for example). :param wps_status: One of :class:`Status` or its literal value to map to `compliant` standard. :param compliant: One of :class:`StatusCompliant` values. :param category: Request that the :class:`StatusCategory` corresponding to the supplied status is returned. :returns: Mapped status complying to the requested compliant category, or :data:`Status.UNKNOWN` if no match found.