Oracle Cloud Infrastructure · Arazzo Workflow

Oracle Cloud Create Metric Alarm

Version 1.0.0

Discover a metric in a namespace, create an alarm on it, then confirm the alarm.

1 workflow 1 source API 1 provider
View Spec View on GitHub Cloud ComputingEnterprise CloudInfrastructure as a ServiceOraclePlatform as a ServiceArazzoWorkflows

Provider

oracle-cloud

Workflows

create-metric-alarm
Discover a metric, create an alarm on it, then confirm the alarm.
Lists metrics to find a target metric, creates an alarm with a threshold query, and reads the alarm back with getAlarm.
3 steps inputs: alarmDisplayName, compartmentId, destinations, metricName, namespace, query, severity outputs: alarmId, lifecycleState
1
listMetrics
listMetrics
List the metrics available in the compartment and namespace to confirm the target metric exists.
2
createAlarm
createAlarm
Create an alarm in the compartment that evaluates the threshold query against the metric namespace.
3
getAlarm
getAlarm
Read the alarm back to confirm it was created and is enabled.

Source API Descriptions

Arazzo Workflow Specification

oracle-cloud-create-metric-alarm-workflow.yml Raw ↑
arazzo: 1.0.1
info:
  title: Oracle Cloud Create Metric Alarm
  summary: Discover a metric in a namespace, create an alarm on it, then confirm the alarm.
  description: >-
    Builds a monitoring alarm grounded in a metric that actually exists. The
    workflow lists the metrics in a compartment and namespace, creates an alarm
    whose query targets the discovered metric, and reads the alarm back to
    confirm it is active. Every step spells out its request inline so the
    alerting flow can be read and executed without opening the underlying OpenAPI
    description.
  version: 1.0.0
sourceDescriptions:
- name: monitoringApi
  url: ../openapi/oracle-cloud-monitoring-openapi.yaml
  type: openapi
workflows:
- workflowId: create-metric-alarm
  summary: Discover a metric, create an alarm on it, then confirm the alarm.
  description: >-
    Lists metrics to find a target metric, creates an alarm with a threshold
    query, and reads the alarm back with getAlarm.
  inputs:
    type: object
    required:
    - compartmentId
    - namespace
    - alarmDisplayName
    - query
    - severity
    - destinations
    properties:
      compartmentId:
        type: string
        description: The OCID of the compartment for the metrics and alarm.
      namespace:
        type: string
        description: The metric namespace (e.g. oci_computeagent).
      metricName:
        type: string
        description: Optional metric name filter for the metric listing.
      alarmDisplayName:
        type: string
        description: A user-friendly name for the alarm.
      query:
        type: string
        description: The Monitoring Query Language threshold expression for the alarm.
      severity:
        type: string
        description: The alarm severity (CRITICAL, ERROR, WARNING, or INFO).
      destinations:
        type: array
        description: The notification destination OCIDs for the alarm.
        items:
          type: string
  steps:
  - stepId: listMetrics
    description: >-
      List the metrics available in the compartment and namespace to confirm the
      target metric exists.
    operationId: listMetrics
    parameters:
    - name: compartmentId
      in: query
      value: $inputs.compartmentId
    - name: name
      in: query
      value: $inputs.metricName
    - name: namespace
      in: query
      value: $inputs.namespace
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      discoveredMetricName: $response.body#/0/name
  - stepId: createAlarm
    description: >-
      Create an alarm in the compartment that evaluates the threshold query
      against the metric namespace.
    operationId: createAlarm
    requestBody:
      contentType: application/json
      payload:
        compartmentId: $inputs.compartmentId
        displayName: $inputs.alarmDisplayName
        metricCompartmentId: $inputs.compartmentId
        namespace: $inputs.namespace
        query: $inputs.query
        severity: $inputs.severity
        isEnabled: true
        destinations: $inputs.destinations
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      alarmId: $response.body#/id
  - stepId: getAlarm
    description: Read the alarm back to confirm it was created and is enabled.
    operationId: getAlarm
    parameters:
    - name: alarmId
      in: path
      value: $steps.createAlarm.outputs.alarmId
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      lifecycleState: $response.body#/lifecycleState
      isEnabled: $response.body#/isEnabled
  outputs:
    alarmId: $steps.createAlarm.outputs.alarmId
    lifecycleState: $steps.getAlarm.outputs.lifecycleState