description
description
This module contains the description of the processes a process-worker serves. It is shaped along the process description of OGC API - Processes - Part 1: Core (https://schemas.opengis.net/ogcapi/processes/part1/1.0/openapi/schemas/process.yaml), so a consumer can expose its elements as they are and only adds what belongs to the API around (links, job control options, conformance, ...).
Optional values default to None. Serialized with
xsdata.formats.dataclass.serializers.dict.DictFactory.FILTER_NONE they are left out,
which gives a plain JSON Schema for each Schema.
QSL_LAYER_FORMAT = 'qsl-layer'
module-attribute
InputDescription
dataclass
Bases: BaseInterface
The description of one input of a process.
OGC API - Processes holds the inputs as map by id. xsdata can't bind a map of dataclasses, therefore the id is part of the description and the inputs are a list.
Attributes:
-
id(str) –The identifier of the input, the QGIS parameter name.
-
title(str) –Human readable name.
-
description(str | None) –Human readable help text.
-
schema(Schema) –The schema of one value.
-
min_occurs(int) –The minimal number of values.
-
max_occurs(int | str) –The maximal number of values,
unboundedfor any.
Source code in src/qgis_server_light/interface/job/process/description.py
84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 | |
description: str | None = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
id: str = field(metadata={'type': 'Element'})
class-attribute
instance-attribute
max_occurs: int | str = field(default=1, metadata={'type': 'Element', 'name': 'maxOccurs'})
class-attribute
instance-attribute
min_occurs: int = field(default=1, metadata={'type': 'Element', 'name': 'minOccurs'})
class-attribute
instance-attribute
schema: Schema = field(metadata={'type': 'Element'})
class-attribute
instance-attribute
shortened_fields: set
property
title: str = field(metadata={'type': 'Element'})
class-attribute
instance-attribute
__init__(*, id: str, title: str, description: str | None = None, schema: Schema, min_occurs: int = 1, max_occurs: int | str = 1) -> None
OutputDescription
dataclass
Bases: BaseInterface
The description of one output of a process. The id is part of the description,
see InputDescription.
Attributes:
-
id(str) –The identifier of the output, the QGIS output name.
-
title(str) –Human readable name.
-
schema(Schema) –The schema of the value.
Source code in src/qgis_server_light/interface/job/process/description.py
112 113 114 115 116 117 118 119 120 121 122 123 124 125 | |
id: str = field(metadata={'type': 'Element'})
class-attribute
instance-attribute
schema: Schema = field(metadata={'type': 'Element'})
class-attribute
instance-attribute
title: str = field(metadata={'type': 'Element'})
class-attribute
instance-attribute
__init__(*, id: str, title: str, schema: Schema) -> None
ProcessDescription
dataclass
Bases: BaseInterface
The description of one process.
Attributes:
-
id(str) –The identifier of the process, the QGIS algorithm id.
-
title(str) –Human readable name.
-
description(str | None) –Human readable help text.
-
inputs(list[InputDescription]) –The inputs which are passed by the client. Destinations are not part of it, they are set by the worker.
-
outputs(list[OutputDescription]) –The outputs the process produces.
-
internal(bool | None) –If the process is for internal use of the consumer only and must not be published. Left out (
None) for a publishable process.
Source code in src/qgis_server_light/interface/job/process/description.py
128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 | |
description: str | None = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
id: str = field(metadata={'type': 'Element'})
class-attribute
instance-attribute
inputs: list[InputDescription] = field(default_factory=list, metadata={'type': 'Element'})
class-attribute
instance-attribute
internal: bool | None = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
outputs: list[OutputDescription] = field(default_factory=list, metadata={'type': 'Element'})
class-attribute
instance-attribute
shortened_fields: set
property
title: str = field(metadata={'type': 'Element'})
class-attribute
instance-attribute
__init__(*, id: str, title: str, description: str | None = None, inputs: list[InputDescription] = list(), outputs: list[OutputDescription] = list(), internal: bool | None = None) -> None
ProcessDescriptions
dataclass
Bases: BaseInterface
The processes a process-worker serves (see RedisProtocol.worker_processes_key),
or all process-workers together as the dispatcher merges them.
Attributes:
-
processes(list[ProcessDescription]) –The description per process.
-
warnings(list[ProcessWarning]) –The processes the workers don't agree on, only set by the dispatcher.
Source code in src/qgis_server_light/interface/job/process/description.py
174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 | |
processes: list[ProcessDescription] = field(default_factory=list, metadata={'type': 'Element'})
class-attribute
instance-attribute
warnings: list[ProcessWarning] = field(default_factory=list, metadata={'type': 'Element'})
class-attribute
instance-attribute
__init__(processes: list[ProcessDescription] = list(), warnings: list[ProcessWarning] = list()) -> None
process_by_id(process_id: str) -> ProcessDescription
Parameters:
-
process_id(str) –The identifier of the process.
Raises:
-
LookupError–If no process with this id is described.
Source code in src/qgis_server_light/interface/job/process/description.py
187 188 189 190 191 192 193 194 195 196 197 198 | |
ProcessWarning
dataclass
Bases: BaseInterface
Tells that the process-workers serving a process don't agree on it. They run different QGIS versions or describe the process differently, so a job behaves differently depending on the worker which takes it. The deployment needs to be corrected then.
Attributes:
-
process_id(str) –The identifier of the process.
-
qgis_versions(list[str]) –The QGIS versions of the workers serving the process, the newest first.
-
descriptions_differ(bool) –If the workers describe the process differently.
Source code in src/qgis_server_light/interface/job/process/description.py
155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 | |
descriptions_differ: bool = field(default=False, metadata={'type': 'Element'})
class-attribute
instance-attribute
process_id: str = field(metadata={'type': 'Element'})
class-attribute
instance-attribute
qgis_versions: list[str] = field(default_factory=list, metadata={'type': 'Element'})
class-attribute
instance-attribute
__init__(*, process_id: str, qgis_versions: list[str] = list(), descriptions_differ: bool = False) -> None
QslLayerKind
Bases: Enum
The kinds of layer QSL can load as value of a process input.
Source code in src/qgis_server_light/interface/job/process/description.py
20 21 22 23 24 | |
RASTER = 'raster'
class-attribute
instance-attribute
VECTOR = 'vector'
class-attribute
instance-attribute
QslLayerMarker
dataclass
Bases: BaseInterface
Marks a schema whose value is a layer (QslJobLayer) instead of a literal. A
consumer replaces the marked schema with the layers it offers which match the marker.
Attributes:
-
kinds(list[QslLayerKind]) –The kinds of layer which are accepted.
-
geometry_types(list[str]) –The geometry types of a vector layer which are accepted, named as
qgis.core.Qgis.GeometryType(Point,Line,Polygon,Null). MatchesVector.geometry_type_simpleof the exported project. Applies to vector layers only, empty when no vector layer is accepted. -
source(str | None) –The class name of the QGIS parameter or output the marker was derived from.
Source code in src/qgis_server_light/interface/job/process/description.py
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 | |
geometry_types: list[str] = field(default_factory=list, metadata={'type': 'Element'})
class-attribute
instance-attribute
kinds: list[QslLayerKind] = field(metadata={'type': 'Element'})
class-attribute
instance-attribute
source: str | None = field(default=None, metadata={'type': 'Element'})
class-attribute
instance-attribute
__init__(kinds: list[QslLayerKind], geometry_types: list[str] = list(), source: str | None = None) -> None
Schema
dataclass
Bases: BaseInterface
The subset of JSON Schema which is used to describe the values of inputs and outputs.
Attributes:
-
type(str | None) –The JSON Schema type (
string,number,integer,boolean, ...). -
format(str | None) –The format of the value. Layer values carry
QSL_LAYER_FORMAT. -
title(str | None) –Human readable name, used on the entries of
one_of. -
minimum(int | float | None) –The inclusive minimum of a numeric value.
-
maximum(int | float | None) –The inclusive maximum of a numeric value.
-
const(bool | int | float | str | None) –The only valid value, used on the entries of
one_of. -
default(bool | int | float | str | None) –The value used when none is passed.
-
one_of(list[Schema] | None) –The valid values, each as schema with
constandtitle. For a file output the formats it is offered in, each as schema withcontent_media_type, the first one is the default. -
content_media_type(str | None) –The media type of a value which is a file.
-
x_qsl_layer(QslLayerMarker | None) –The marker of a layer value.
Source code in src/qgis_server_light/interface/job/process/description.py
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 | |