arazzo: 1.0.1 info: title: Sysdig Create Alert With Notification Channel summary: Create a notification channel, then create an alert that routes to it. description: >- An alert provisioning flow for Sysdig Monitor. It creates a notification channel for alert routing, captures the generated channel id, and creates a monitoring alert whose notificationChannelIds reference that channel so firings are delivered. The alert is then read back to confirm it persisted. Every step spells out its request inline so the flow can be read and executed without opening the underlying OpenAPI description. version: 1.0.0 sourceDescriptions: - name: sysdigMonitor url: ../openapi/sysdig-monitor-openapi.yml type: openapi workflows: - workflowId: create-alert-with-channel summary: Provision a notification channel and an alert wired to it. description: >- Creates a notification channel, then creates an alert referencing the channel id, and verifies the alert by reading it back. inputs: type: object required: - bearerToken - channelName - channelType - alertName - condition properties: bearerToken: type: string description: Sysdig API bearer token used for Authorization. channelName: type: string description: Name of the notification channel. channelType: type: string description: Channel type (EMAIL, SLACK, WEBHOOK, PAGERDUTY, etc.). channelOptions: type: object description: Channel-specific options (e.g. emailRecipients, url). alertName: type: string description: Name of the monitoring alert. condition: type: string description: Alert condition expression. steps: - stepId: createChannel description: Create the notification channel used for alert routing. operationId: createNotificationChannel parameters: - name: Authorization in: header value: Bearer $inputs.bearerToken requestBody: contentType: application/json payload: notificationChannel: name: $inputs.channelName type: $inputs.channelType options: $inputs.channelOptions enabled: true successCriteria: - condition: $statusCode == 201 outputs: channelId: $response.body#/notificationChannel/id - stepId: createAlert description: Create the alert and route it to the new channel. operationId: createAlert parameters: - name: Authorization in: header value: Bearer $inputs.bearerToken requestBody: contentType: application/json payload: alert: name: $inputs.alertName condition: $inputs.condition severity: 4 enabled: true type: MANUAL notificationChannelIds: - $steps.createChannel.outputs.channelId successCriteria: - condition: $statusCode == 201 outputs: alertId: $response.body#/alert/id - stepId: verifyAlert description: Read the alert back by id to confirm it persisted. operationId: getAlert parameters: - name: Authorization in: header value: Bearer $inputs.bearerToken - name: alertId in: path value: $steps.createAlert.outputs.alertId successCriteria: - condition: $statusCode == 200 outputs: alertId: $response.body#/alert/id enabled: $response.body#/alert/enabled outputs: channelId: $steps.createChannel.outputs.channelId alertId: $steps.verifyAlert.outputs.alertId