SOTHOOK

The SOTHOOK is a combination of two webhooks that are required for yuuvis® client as reference implementation for proper handling of an object's lifecycle.

Table of Contents

Characteristics

Service Namesothook
Port Range10779
Profilesprod
Helm Chartclient
Public API-

Function

Handling of secondary object types in yuuvis® client as reference implementation.

Configuration

k8s-service
apiVersion: v1
kind: Service
metadata:
  labels:
    app: yuuvis
    yuuvis: "true"
    name: sothook
  name: sothook
  namespace: yuuvis
spec:
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: 10779
  selector:
    name: sothook
  type: ClusterI
k8s-deployment
apiVersion: apps/v1
kind: Deployment
metadata:
  namespace: yuuvis
  labels:
    app: yuuvis
    name: sothook
  name: sothook
spec:
  replicas: 1
  selector:
     matchLabels:
      name: sothook
  template:
    metadata:
      labels:
        app: yuuvis
        name: sothook
    spec:
      initContainers:
      - name: init-sothook
        image: busybox
        command: ["sh", "-c", "until wget -q --spider http://configservice/manage/health; do echo waiting for configservice; sleep 11; done;"]
        imagePullPolicy: IfNotPresent
      containers:
      - name: sothook
        image: docker.yuuvis.org/yuuvis/sandbox/sot-hook:1.0.0-RC01
        imagePullPolicy: Always
        env:
        - name: JAVA_OPTS
          value: -Xmx256m
        - name: SPRING_PROFILES_ACTIVE
          value: prod,kubernetes
        - name: SPRING_CLOUD_CONFIG_URI
          value: "http://configservice/config"
        ports:
        - containerPort: 10779
      restartPolicy: Always
      imagePullSecrets:
      - name: flexsecret

In the cluster, the "system/systemHookConfiguration.json" file must be adapted in the CONFIGSERVICE - in the webhook array, these two entries must be added

webhook array entries
{
        "enable": true,
        "predicate": "spel:(options==null || options['currentVersion']==null)",
        "type": "dms.request.import.storage.before",
        "url": "http://sothook/api/dms/request/import",
        "useDiscovery": true
      },
      {
        "enable": true,
        "predicate": "spel:options!=null && options['currentVersion']!=null && options['currentVersion']['properties']['system:secondaryObjectTypeIds'] != null && options['currentVersion']['properties']['system:secondaryObjectTypeIds']['value'].contains('appClientsystem:leadingType')",
        "type": "dms.request.update.metadata",
        "url": "http://sothook/api/dms/request/update/metadata",
        "useDiscovery": true
	}