Примеры интеграций

GitHub Actions

# .github/workflows/notify.yml
- name: Notify Aulynk
  if: always()
  run: |
    STATUS="${{ job.status }}"
    curl -X POST ${{ secrets.AULYNK_WEBHOOK }} \
      -H "Content-Type: application/json" \
      -d "{
        \"text\": \"## CI: ${{ github.repository }}\n\n- **Branch**: ${{ github.ref_name }}\n- **Status**: \`${STATUS}\`\n- **Commit**: ${{ github.sha }}\",
        \"username\": \"GitHub Actions\"
      }"

GitLab CI

notify:
  stage: deploy
  script:
    - |
      curl -X POST "$AULYNK_WEBHOOK" \
        -H "Content-Type: application/json" \
        -d "{
          \"text\": \"Pipeline **${CI_PIPELINE_ID}** for ${CI_PROJECT_NAME}: \`${CI_JOB_STATUS}\`\",
          \"username\": \"GitLab CI\"
        }"

Grafana

  1. В Grafana перейдите в Alerting > Contact points
  2. Добавьте contact point типа Webhook
  3. URL: ваш webhook URL
  4. Method: POST

Jenkins

post {
    always {
        script {
            def status = currentBuild.result ?: 'SUCCESS'
            httpRequest(
                url: env.AULYNK_WEBHOOK,
                httpMode: 'POST',
                contentType: 'APPLICATION_JSON',
                requestBody: """{"text": "**${env.JOB_NAME}** #${env.BUILD_NUMBER}: `${status}`", "username": "Jenkins"}"""
            )
        }
    }
}

Python

import requests

WEBHOOK_URL = "https://your-server/api/webhooks/YOUR_TOKEN"

requests.post(WEBHOOK_URL, json={
    "text": "**Alert**: CPU usage > 90%",
    "username": "Monitoring"
})

curl (одной строкой)

curl -X POST https://your-server/api/webhooks/TOKEN \
  -H "Content-Type: application/json" \
  -d '{"text": "Hello from webhook!"}'