Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
111 changes: 89 additions & 22 deletions api/v3/wfs_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,36 +66,80 @@ func init() {

// WFSSpec vertegenwoordigt de hoofdstruct voor de YAML-configuratie
type WFSSpec struct {
// Optional lifecycle settings
Lifecycle *shared_model.Lifecycle `json:"lifecycle,omitempty"`
// +kubebuilder:validation:Type=object
// +kubebuilder:validation:Schemaless
// +kubebuilder:pruning:PreserveUnknownFields
// Optional strategic merge patch for the pod in the deployment. E.g. to patch the resources or add extra env vars.

PodSpecPatch *corev1.PodSpec `json:"podSpecPatch,omitempty"`
HorizontalPodAutoscalerPatch *autoscalingv2.HorizontalPodAutoscalerSpec `json:"horizontalPodAutoscalerPatch,omitempty"`
Options Options `json:"options,omitempty"`
Service WFSService `json:"service"`

// service configuration
// +kubebuilder:validation:Required
Service WFSService `json:"service"`
}

type WFSService struct {
// Geonovum subdomein
// +kubebuilder:validation:MinLength:=1
Prefix string `json:"prefix"`
URL string `json:"url"`
Inspire *Inspire `json:"inspire,omitempty"`
Mapfile *Mapfile `json:"mapfile,omitempty"`
OwnerInfoRef string `json:"ownerInfoRef"`
Title string `json:"title"`
Abstract string `json:"abstract"`
Keywords []string `json:"keywords"`
Fees *string `json:"fees,omitempty"`
Prefix string `json:"prefix"`

// URL of the service
// +kubebuilder:validation:Pattern:=`^https?://.*$`
URL string `json:"url"`

// check for Inspire services
// +kubebuilder:default="false"
Inspire *Inspire `json:"inspire,omitempty"`

// External Mapfile reference
Mapfile *Mapfile `json:"mapfile,omitempty"`

// Reference to OwnerInfo CR
// TODO no webhook yet?
// +kubebuilder:validation:MinLength:=1
OwnerInfoRef string `json:"ownerInfoRef"`

// Service title
// +kubebuilder:validation:MinLength:=1
Title string `json:"title"`

// Service abstract
// +kubebuilder:validation:MinLength:=1
Abstract string `json:"abstract"`

// Keywords for capabilities
// +kubebuilder:validation:MinItems:=1
Keywords []string `json:"keywords"`

// Optional Fees
Fees *string `json:"fees,omitempty"`

// AccessConstraints URL
// +kubebuilder:validation:Pattern:="https?://"
// +kubebuilder:default="https://creativecommons.org/publicdomain/zero/1.0/deed.nl"
AccessConstraints string `json:"accessConstraints"`
DefaultCrs string `json:"defaultCrs"`
OtherCrs []string `json:"otherCrs,omitempty"`
Bbox *Bbox `json:"bbox,omitempty"`
AccessConstraints string `json:"accessConstraints"`

// Default CRS (DataEPSG)
// +kubebuilder:validation:Pattern:="^EPSG:(28992|25831|25832|3034|3035|3857|4258|4326)$"
// +kubebuilder:validation:MinLength:=1
DefaultCrs string `json:"defaultCrs"`

// Other supported CRS
OtherCrs []string `json:"otherCrs,omitempty"`

// Service bounding box
Bbox *Bbox `json:"bbox,omitempty"`

// CountDefault -> wfs_maxfeatures in mapfile
CountDefault *string `json:"countDefault,omitempty"`
// +kubebuilder:validation:MinLength:=1
CountDefault *string `json:"countDefault,omitempty"`

// FeatureTypes configurations
// +kubebuilder:validation:MinItems:=1
FeatureTypes []FeatureType `json:"featureTypes"`
}

Expand All @@ -105,14 +149,37 @@ type Bbox struct {
DefaultCRS shared_model.BBox `json:"defaultCRS"`
}

// FeatureType defines a WFS feature
// +kubebuilder:validation:Required
type FeatureType struct {
Name string `json:"name"`
Title string `json:"title"`
Abstract string `json:"abstract"`
Keywords []string `json:"keywords"`
DatasetMetadataURL MetadataURL `json:"datasetMetadataUrl"`
Bbox *FeatureBbox `json:"bbox,omitempty"`
Data Data `json:"data"`
// Name of the feature
// +kubebuilder:validation:MinLength:=1
Name string `json:"name"`

// Title of the feature
// +kubebuilder:validation:MinLength:=1
Title string `json:"title"`

// Abstract of the feature
// +kubebuilder:validation:MinLength:=1
Abstract string `json:"abstract"`

// Keywords of the feature
// +kubebuilder:validation:MinItems:=1
Keywords []string `json:"keywords"`

// Metadata URL
// +kubebuilder:validation:Type=object
DatasetMetadataURL MetadataURL `json:"datasetMetadataUrl"`

// Optional feature bbox
// +kubebuilder:validation:Optional
// +kubebuilder:validation:Type:=object
Bbox *FeatureBbox `json:"bbox,omitempty"`

// Featuretype data connection
// +kubebuilder:validation:Required
Data Data `json:"data"`
}

type FeatureBbox struct {
Expand Down
40 changes: 38 additions & 2 deletions config/crd/bases/pdok.nl_wfs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1086,6 +1086,7 @@ spec:
- scaleTargetRef
type: object
lifecycle:
description: Optional lifecycle settings
properties:
ttlInDays:
format: int32
Expand Down Expand Up @@ -1118,18 +1119,22 @@ spec:
- includeIngress
type: object
podSpecPatch:
description: Optional strategic merge patch for the pod in the deployment.
E.g. to patch the resources or add extra env vars.
type: object
x-kubernetes-preserve-unknown-fields: true
service:
description: service configuration
properties:
abstract:
description: Service abstract
minLength: 1
type: string
accessConstraints:
default: https://creativecommons.org/publicdomain/zero/1.0/deed.nl
description: AccessConstraints URL
pattern: https?://
type: string
bbox:
description: Service bounding box
properties:
defaultCRS:
description: EXTENT/wfs_extent in mapfile
Expand Down Expand Up @@ -1161,15 +1166,24 @@ spec:
type: object
countDefault:
description: CountDefault -> wfs_maxfeatures in mapfile
minLength: 1
type: string
defaultCrs:
description: Default CRS (DataEPSG)
minLength: 1
pattern: ^EPSG:(28992|25831|25832|3034|3035|3857|4258|4326)$
type: string
featureTypes:
description: FeatureTypes configurations
items:
description: FeatureType defines a WFS feature
properties:
abstract:
description: Abstract of the feature
minLength: 1
type: string
bbox:
description: Optional feature bbox
properties:
defaultCRS:
description: BBox defines a bounding box with coordinates
Expand Down Expand Up @@ -1225,6 +1239,7 @@ spec:
- defaultCRS
type: object
data:
description: Featuretype data connection
properties:
gpkg:
properties:
Expand Down Expand Up @@ -1290,6 +1305,7 @@ spec:
type: object
type: object
datasetMetadataUrl:
description: Metadata URL
properties:
csw:
properties:
Expand All @@ -1312,12 +1328,18 @@ spec:
- csw
type: object
keywords:
description: Keywords of the feature
items:
type: string
minItems: 1
type: array
name:
description: Name of the feature
minLength: 1
type: string
title:
description: Title of the feature
minLength: 1
type: string
required:
- abstract
Expand All @@ -1327,10 +1349,14 @@ spec:
- name
- title
type: object
minItems: 1
type: array
fees:
description: Optional Fees
type: string
inspire:
default: "false"
description: check for Inspire services
properties:
language:
type: string
Expand Down Expand Up @@ -1364,10 +1390,13 @@ spec:
- spatialDatasetIdentifier
type: object
keywords:
description: Keywords for capabilities
items:
type: string
minItems: 1
type: array
mapfile:
description: External Mapfile reference
properties:
configMapKeyRef:
description: Selects a key from a ConfigMap.
Expand Down Expand Up @@ -1396,18 +1425,25 @@ spec:
- configMapKeyRef
type: object
otherCrs:
description: Other supported CRS
items:
type: string
type: array
ownerInfoRef:
description: Reference to OwnerInfo CR
minLength: 1
type: string
prefix:
description: Geonovum subdomein
minLength: 1
type: string
title:
description: Service title
minLength: 1
type: string
url:
description: URL of the service
pattern: ^https?://.*$
type: string
required:
- abstract
Expand Down
Loading