Webhook

The webhook workflow step makes an HTTP request to an endpoint once the step is reached. This type of step is useful to notify other applications and/or discovery mechanism that a new application has been launched. To send messages to Slack or other messaging system, use the notification workflow step.

The following snippet contains an example application sending a request to a webhook after the application is deployed.

apiVersion: core.oam.dev/v1beta1
kind: Application
metadata:
  name: webhook-app
  annotations:
    version: "v1.0.0"
    description: "My webhook application"
spec:
  components:
    - name: component1
      type: worker
      properties:
        image: busybox
        cmd: ["sleep", "86400"] 
        cpu: "0.25"
        memory: "200Mi"        
  workflow:
    steps:
      - name: step1
        type: apply-application
      - name: step2
        type: webhook # Set to webhook
        properties:
          # Webhook URl mandatory (url or secretRef)
          url: # (Optional)
            value: <url> # (Required) webhook url
          secretRef:
            name: secret-name # (Required) secret name
            key: key # (Required) secret key
        data: data # (Optional) data to send