Skip to content

gavicore.models API Reference

gavicore.models - OGC Processes

gavicore.models.ProcessList

Bases: OgcBaseModel

A list of process summaries.

processes instance-attribute

processes: list[ProcessSummary]

The process summaries

links: list[Link]

Related links.

gavicore.models.ProcessSummary

Bases: DescriptionType

A brief process descriptions lacking details of inputs and outputs.

id instance-attribute

id: str

Process identifier.

version instance-attribute

version: str

Process version number.

mutable class-attribute instance-attribute

mutable: bool | None = None

Mutability of process. This value is True for processes deployed dynamically to DRU-enabled servers.

jobControlOptions class-attribute instance-attribute

jobControlOptions: list[JobControlOptions] | None = None

Available options to control process execution.

outputTransmission class-attribute instance-attribute

outputTransmission: list[TransmissionMode] | None = None

Available output transmission modes.

links: list[Link] | None = None

Related links.

title class-attribute instance-attribute

title: str | None = None

Human-readable title.

description class-attribute instance-attribute

description: str | None = None

Description text. May contain rich-text markups (markdown).

keywords class-attribute instance-attribute

keywords: list[str] | None = None

Optional list of keywords.

metadata class-attribute instance-attribute

metadata: list[Metadata] | None = None

Optional list of related metadata.

additionalParameters class-attribute instance-attribute

additionalParameters: AdditionalParameters | None = None

Optional list of additional parameters. Mostly ignored.

gavicore.models.ProcessDescription

Bases: ProcessSummary

Description of a process.

inputs class-attribute instance-attribute

inputs: dict[str, InputDescription] | None = None

Descriptions of the process inputs.

outputs class-attribute instance-attribute

outputs: dict[str, OutputDescription] | None = None

Descriptions of the process outputs.

title class-attribute instance-attribute

title: str | None = None

Human-readable title.

description class-attribute instance-attribute

description: str | None = None

Description text. May contain rich-text markups (markdown).

keywords class-attribute instance-attribute

keywords: list[str] | None = None

Optional list of keywords.

metadata class-attribute instance-attribute

metadata: list[Metadata] | None = None

Optional list of related metadata.

additionalParameters class-attribute instance-attribute

additionalParameters: AdditionalParameters | None = None

Optional list of additional parameters. Mostly ignored.

id instance-attribute

id: str

Process identifier.

version instance-attribute

version: str

Process version number.

mutable class-attribute instance-attribute

mutable: bool | None = None

Mutability of process. This value is True for processes deployed dynamically to DRU-enabled servers.

jobControlOptions class-attribute instance-attribute

jobControlOptions: list[JobControlOptions] | None = None

Available options to control process execution.

outputTransmission class-attribute instance-attribute

outputTransmission: list[TransmissionMode] | None = None

Available output transmission modes.

links: list[Link] | None = None

Related links.

gavicore.models.InputDescription

Bases: DescriptionType

Description of an input of a process.

minOccurs class-attribute instance-attribute

minOccurs: int | None = 1

Minimum number of occurrences of this input. Usually ignored as an array schema is more flexible.

maxOccurs class-attribute instance-attribute

maxOccurs: int | Literal['unbounded'] | None = None

Maximum number of occurrences of this input. Usually ignored as an array schema is more flexible.

schema_ class-attribute instance-attribute

schema_: Schema = Field(..., alias='schema')

The OpenAPI schema of the input value(s).

title class-attribute instance-attribute

title: str | None = None

Human-readable title.

description class-attribute instance-attribute

description: str | None = None

Description text. May contain rich-text markups (markdown).

keywords class-attribute instance-attribute

keywords: list[str] | None = None

Optional list of keywords.

metadata class-attribute instance-attribute

metadata: list[Metadata] | None = None

Optional list of related metadata.

additionalParameters class-attribute instance-attribute

additionalParameters: AdditionalParameters | None = None

Optional list of additional parameters. Mostly ignored.

gavicore.models.OutputDescription

Bases: DescriptionType

Description of an output of a process.

schema_ class-attribute instance-attribute

schema_: Schema = Field(..., alias='schema')

The OpenAPI schema of the output value.

title class-attribute instance-attribute

title: str | None = None

Human-readable title.

description class-attribute instance-attribute

description: str | None = None

Description text. May contain rich-text markups (markdown).

keywords class-attribute instance-attribute

keywords: list[str] | None = None

Optional list of keywords.

metadata class-attribute instance-attribute

metadata: list[Metadata] | None = None

Optional list of related metadata.

additionalParameters class-attribute instance-attribute

additionalParameters: AdditionalParameters | None = None

Optional list of additional parameters. Mostly ignored.

gavicore.models.ProcessRequest

Bases: OgcBaseModel

A request for a process execution.

inputs class-attribute instance-attribute

inputs: dict[str, Any] | None = None

Optional process inputs given as key-value mapping. Values may be of any JSON-serializable type accepted by the given process.

outputs class-attribute instance-attribute

outputs: dict[str, Output] | None = None

Optional process outputs given as key-value mapping. Values are of type Output supported by the given process.

subscriber class-attribute instance-attribute

subscriber: Subscriber | None = None

Optional subscriber of type Subscriber comprising callback URLs that are informed about process status changes while the processing takes place.

response class-attribute instance-attribute

response: ResponseType | None = ResponseType.raw

Optional response type given as key-value mapping. Maybe just ignored.

gavicore.models.Subscriber

Bases: OgcBaseModel

Optional URIs for callbacks for this job.

Support for this parameter is not required and the parameter may be removed from the API definition, if conformance class 'callback' is not listed in the conformance declaration under /conformance.

successUri class-attribute instance-attribute

successUri: AnyUrl | None = None

Optional callback URI to notify about a successfully executed job..

inProgressUri class-attribute instance-attribute

inProgressUri: AnyUrl | None = None

Optional callback URI to notify about the incremental progress made by a job.

failedUri class-attribute instance-attribute

failedUri: AnyUrl | None = None

Optional callback URI to notify in case of a job failure.

gavicore.models.Output

Bases: OgcBaseModel

Expected output of a process execution.

format class-attribute instance-attribute

format: Format | None = None

Desired format.

transmissionMode class-attribute instance-attribute

transmissionMode: TransmissionMode | None = TransmissionMode.value

Desired transmission mode.

gavicore.models - OGC Process Jobs

gavicore.models.JobList

Bases: OgcBaseModel

A list of jobs.

jobs instance-attribute

jobs: list[JobInfo]

The job information list.

links: list[Link]

Related links.

gavicore.models.JobInfo

Bases: OgcBaseModel

Information about a job.

jobID instance-attribute

jobID: str

The job identifier.

processID class-attribute instance-attribute

processID: str | None = None

The job's process identifier.

type class-attribute instance-attribute

type: Literal['process'] = 'process'

The job type (always "process", ignored).

status instance-attribute

status: JobStatus

The job status.

message class-attribute instance-attribute

message: str | None = None

The success, progress, or failure message.

created class-attribute instance-attribute

created: AwareDatetime | None = None

Job creation time.

started class-attribute instance-attribute

started: AwareDatetime | None = None

Job start time.

finished class-attribute instance-attribute

finished: AwareDatetime | None = None

Job end time.

updated class-attribute instance-attribute

updated: AwareDatetime | None = None

Job update time.

progress class-attribute instance-attribute

progress: int | None = Field(None, ge=0, le=100)

The progress in percent in the range 0 to 100.

links: list[Link] | None = None

Related links.

traceback class-attribute instance-attribute

traceback: str | list[str] | None = Field(None, alias='x-traceback')

Server-side traceback in case of failure.

gavicore.models.JobStatus

Bases: Enum

Status of a job.

gavicore.models.JobResult module-attribute

JobResult: TypeAlias = Link | QualifiedValue | InlineValue

The type representing the a single result of a job.

gavicore.models.JobResults

Bases: RootModel[dict[str, JobResult] | None]

A job's results. Basically a mapping from output name to JobResult.

gavicore.models.ApiError

Bases: OgcBaseModel

API error information based on RFC7807.

type instance-attribute

type: str

A URI identifying the problem type, e.g., https://example.com/probs/validation-error.

title class-attribute instance-attribute

title: str | None = None

A short, human-readable summary of the problem.

status class-attribute instance-attribute

status: int | None = None

The HTTP status code, e.g., 422.

detail class-attribute instance-attribute

detail: str | None = None

A detailed explanation of the problem.

instance class-attribute instance-attribute

instance: str | None = None

A URI identifying the specific occurrence of the problem.

traceback class-attribute instance-attribute

traceback: str | list[str] | None = Field(None, alias='x-traceback')

Server-side traceback.

gavicore.models - OGC Application Package and Workflow descriptions

gavicore.dru_models.OgcApplicationPackage

Bases: BaseModel

An OGC Application Package is a document that describes a process in sufficient detail so that an implementation of this Standard can dynamically deploy that process and make it accessible via an the processes API defined in "OGC API - Processes - Part 1: Core".

For more information, see: /req/ogcapppkg/schema

process_description class-attribute instance-attribute

process_description: OgcApplicationPackageProcessDescription | None = Field(
    None, alias="processDescription"
)

Process description of a given process.

execution_unit class-attribute instance-attribute

execution_unit: ExecutionUnitBase | list[ExecutionUnitBase] = Field(
    alias="executionUnit"
)

The execution unit of process.

gavicore.dru_models.OgcApplicationPackageProcessDescription

Bases: BaseModel

Wrapper around ProcessDescription to insert additional field name.

process class-attribute instance-attribute

process: ProcessDescription | None = None

The process description.

gavicore.dru_models.CwlDescription

Bases: BaseModel

Possible encoding of an execution unit as CWL.

media_type instance-attribute

media_type: Annotated[Literal["application/cwl"], Field(..., alias="mediaType")]

Media type used to identify the execution unit type. Must always be 'application/cwl'.

value class-attribute instance-attribute

value: dict[str, Any] | None = None

JSON-encoded CWL document.

gavicore.dru_models.ContainerImage

Bases: BaseModel

The execute unit is a container image.

type instance-attribute

type: Literal['docker', 'oci']

Type of container image.

value class-attribute instance-attribute

value: ExecutionUnitContainer | None = None

Description of container image

gavicore.dru_models.ExecutionUnitContainer

Bases: OgcBaseModel

Execution unit described by a container image.

image instance-attribute

image: str

Container image reference for the execution unit.

deployment class-attribute instance-attribute

deployment: Literal['local', 'remote', 'hpc', 'cloud'] | None = None

Deployment information for the execution unit.

config class-attribute instance-attribute

config: ContainerConfig | None = None

Optional configuration for image execution.

bindings class-attribute instance-attribute

bindings: ContainerBindings | None = None

Binding properties for inputs and outputs.

gavicore.dru_models.ContainerConfig

Bases: OgcBaseModel

Hardware requirements and configuration properties for executing the process.

cpu_min class-attribute instance-attribute

cpu_min: int | None = Field(None, ge=1, alias='cpuMin')

Minimum number of CPUs required to run the process (unit is CPU core).

cpu_max class-attribute instance-attribute

cpu_max: int | None = Field(None, alias='cpuMax')

Maximum number of CPU dedicated to the process (unit is CPU core).

memory_min class-attribute instance-attribute

memory_min: int | float | None = Field(None, alias='memoryMin')

Minimum RAM memory required to run the application (unit is GB).

memory_max class-attribute instance-attribute

memory_max: int | float | None = Field(None, alias='memoryMax')

Maximum RAM memory dedicated to the application (unit is GB).

storage_temp_min class-attribute instance-attribute

storage_temp_min: int | float | None = Field(None, alias='storageTempMin')

Minimum required temporary storage size (unit is GB).

storage_outputs_min class-attribute instance-attribute

storage_outputs_min: int | float | None = Field(None, alias="storageOutputsMin")

Minimum required output storage size (unit is GB).

job_timeout class-attribute instance-attribute

job_timeout: int | float | None = Field(None, alias='jobTimeout')

Timeout delay for a job execution (in seconds).

gavicore.dru_models.ContainerBindings

Bases: BaseModel

Input and output bindings of a container image execution unit.

input_bindings class-attribute instance-attribute

input_bindings: InputBinding | None = Field(None, alias='inputBindings')

Input bindings.

output_bindings class-attribute instance-attribute

output_bindings: OutputBinding | None = Field(None, alias='outputBindings')

Output bindings.

gavicore.dru_models.InputBinding

Bases: OgcBaseModel

Defines how to specify the input for the execution unit.

  • The value of various properties defined below can be expressions.
  • The expression language SHALL be JavaScript(???).
  • The "$(...)" syntax can be used to reference the current input or other process inputs in an expression.
    • The value "self" refers to the value of the current input.
    • The value "inputs." refers to the value of another process input.
    • If the input is defined as a string of format "file" or "directory" then the meta-values ".path", ".basename", ".nameroot" and ".nameext" can be used to manipulate file or directory name without having to resort to complex regular expressions.
      • ".path" returns the path of a file name without the file name
      • ".basename" returns the name of the file without the path
      • ".nameroot" returns the basename without any extension
      • ".nameext" returns the extension of the basename

prefix class-attribute instance-attribute

prefix: str | None = None

Command line prefix to add before the value.

position class-attribute instance-attribute

position: int | str | None = None
  • The zero-based sorting key.
  • The value can be an integer or a string.
  • If the value is a string then it should be an expression that evaluates to a single integer value or null.

value_from class-attribute instance-attribute

value_from: str | None = Field(None, alias='valueFrom')
  • If valueFrom is a constant string value, use this as the value.
  • If valueFrom is an expression, evaluate the expression to yield the actual value to use to build the command line.
  • If the value of the associated input parameter is null, valueFrom is not evaluated and nothing is added to the command line.

item_separator class-attribute instance-attribute

item_separator: str | None = Field(None, alias='itemSeparator')

Join the array elements into a single string with the elements separated by itemSeparator.

shell_quote class-attribute instance-attribute

shell_quote: bool | None = Field(None, alias='shellQuote')
  • A Boolean that controls whether the value is quoted on the command.
  • A value of true (or if shecllQuote is not provided) means that the implementation SHALL not permit the interpretation of any shell metacharacters or directives.
  • A value of false should be used to inject metacharacters for operations such as pipes.

gavicore.dru_models.OutputBinding

Bases: OgcBaseModel

Defines how to retrieve the output result from the command.

glob class-attribute instance-attribute

glob: str | list[str] | None = None
  • Wildcard pattern to find the output on disk or mounted volume.
  • Uses UNIX "glob" wildcard patterns (see: "man 7 glob").
  • See inputBinding.yaml (modeled as InputBinding) for referencing input values in an output binding "glob" expression.

gavicore.dru_models.GenericExecutionUnit

Bases: BaseModel

A generic execution unit.

The standard notes

The execution unit is not Docker/OCI or CWL and cannot be properly described via the "mediaType" property of a qualified value using an RFC 2046 media type (e.g. an "R" or "Python" script). In this case a community-defined or custom token may be used with the "type" property.

type instance-attribute

type: str

Type of execution unit

gavicore.models - OpenAPI Schema

gavicore.models.DataType

Bases: Enum

The optional data type of Schema.

gavicore.models.Schema

Bases: OgcBaseModel

Representation of the OpenAPI 3.0 Schema.

The OpenAPI 3.0 Schema is a subset of JSON Schema draft-05 with some noticeable extensions.

Most importantly,

  • type is not allowed to be an array of types, and it is not allowed to be "null". To indicate a value that can be None, nullable=True is used to allow a value to be None, instead of type=["string", "null"] in JSON Schema.
  • items must a schema, which means tuples are not supported. (tuple = a schema of type "array" with fixed-length items being an array of possibly distinct schemas.

Keywords and constructs that do not exist in JSON Schema:

- `nullable = True`
- `deprecated == True`
- `readOnly = True`
- `writeOnly = True`
- `discriminator`
- `xml`
- `example`

Keywords and constructs that are supported in JSON Schema, but not in OpenAPI 3.0 Schema:

- `const`
- `if` / `then` / `else`
- `contains`
- `patternProperties`
- `dependencies`

Note that OpenAPI Schemas are extendable; application-specific fields are usually prefixed by "x-". For example, x-ui or x-ui:widget.

type class-attribute instance-attribute

type: DataType | None = None

Schema type.

title class-attribute instance-attribute

title: str | None = None

Schema type.

description class-attribute instance-attribute

description: str | None = None

Schema type.

enum class-attribute instance-attribute

enum: list | None = Field(None, min_length=1)

Schema type.

default class-attribute instance-attribute

default: Any | None = None

Optional default value.

nullable class-attribute instance-attribute

nullable: bool | None = False

Whether the value can have value null (Python None).

readOnly class-attribute instance-attribute

readOnly: bool | None = False

Whether the value is read-only. Not used.

writeOnly class-attribute instance-attribute

writeOnly: bool | None = False

Whether the value is write-only. Not used.

example class-attribute instance-attribute

example: Any | None = None

Example value. Deprecated, use examples.

examples class-attribute instance-attribute

examples: list[Any] | None = None

One or more example values.

deprecated class-attribute instance-attribute

deprecated: bool | None = False

Whether the value is deprecated..

minimum class-attribute instance-attribute

minimum: int | float | None = None

Minimum value for numeric values.

maximum class-attribute instance-attribute

maximum: int | float | None = None

Maximum value for numeric values.

exclusiveMinimum class-attribute instance-attribute

exclusiveMinimum: bool | None = False

Whether the minimum value is exclusive.

exclusiveMaximum class-attribute instance-attribute

exclusiveMaximum: bool | None = False

Whether the maximum value is exclusive.

multipleOf class-attribute instance-attribute

multipleOf: float | None = Field(None, gt=0.0)

A numeric value must be divisible by this factor without rest.

minLength class-attribute instance-attribute

minLength: int | None = Field(0, ge=0)

Minimum length of a string value.

maxLength class-attribute instance-attribute

maxLength: int | None = Field(None, ge=0)

Maximum length of a string value.

format class-attribute instance-attribute

format: str | None = None

Format of a string value.

pattern class-attribute instance-attribute

pattern: str | None = None

Pattern of a string value.

contentMediaType class-attribute instance-attribute

contentMediaType: str | None = None

Content media type of a binary/string value.

contentEncoding class-attribute instance-attribute

contentEncoding: str | None = None

Content encoding a binary/string value.

contentSchema class-attribute instance-attribute

contentSchema: str | None = None

Content schema of a binary/string value.

items class-attribute instance-attribute

items: Schema | None = None

Schema of the items of an array value.

minItems class-attribute instance-attribute

minItems: int | None = Field(0, ge=0)

Minimum number of items of an array value.

maxItems class-attribute instance-attribute

maxItems: int | None = Field(None, ge=0)

Maximum number of items of an array value.

uniqueItems class-attribute instance-attribute

uniqueItems: bool | None = False

?

properties class-attribute instance-attribute

properties: dict[str, Schema] | None = None

Schemas of the properties of an object value.

required class-attribute instance-attribute

required: list[str] | None = Field(None, min_length=1)

List of names of required properties of an object value.

minProperties class-attribute instance-attribute

minProperties: int | None = Field(0, ge=0)

Minimum number of properties of an object value.

maxProperties class-attribute instance-attribute

maxProperties: int | None = Field(None, ge=0)

Maximum number of properties of an object value.

additionalProperties class-attribute instance-attribute

additionalProperties: Schema | bool | None = True

The common schema for additional properties of an object value. If a boolean is provided, whether or not additional properties are allowed.

not_ class-attribute instance-attribute

not_: Schema | None = Field(None, alias='not')

A value must not match the not-schema. Alias is not.

allOf class-attribute instance-attribute

allOf: list[Schema] | None = None

A value must match all of the schemas in the allOf list.

oneOf class-attribute instance-attribute

oneOf: list[Schema] | None = None

A value must match one of the schemas in the oneOf list.

anyOf class-attribute instance-attribute

anyOf: list[Schema] | None = None

A value must match any of the schemas in the anyOf list.

discriminator class-attribute instance-attribute

discriminator: Discriminator | None = None

Optional discriminator.

id class-attribute instance-attribute

id: str | None = Field(None, alias='$id', min_length=1)

Schema identifier. Alias is $id.

ref class-attribute instance-attribute

ref: str | None = Field(None, alias='$ref', min_length=1)

Schema reference. Alias is $ref.

to_json_dict

to_json_dict() -> dict[str, Any]

Convert this model into a JSON-serializable dict.

gavicore.models.Discriminator

Bases: OgcBaseModel

OpenAPI discriminator used in conjunctions with oneOf/anyOf given that

  • all entries are references of the form {"$ref": "#/..."}` and
  • the referred schemas have type "object" and
  • the referred schemas have a common property whose value can be used to discriminate their meta-type.

propertyName class-attribute instance-attribute

propertyName: str = Field(..., min_length=1)

The common property's name. Required.

mapping class-attribute instance-attribute

mapping: dict[str, str] | None = None

Optional mapping of possible values of the common property to schemas references.