workflow:
  id: openshift-basic-monitoring
  name: OpenShift Basic Monitoring
  description: Simple OpenShift monitoring workflow that gets cluster status and pod information
  triggers:
    - type: manual
  steps:
    # Get all OpenShift projects
    - name: get-projects
      provider:
        type: openshift
        config: "{{ providers.openshift }}"
        with:
          command_type: get_projects

    # Get all pods
    - name: get-pods
      provider:
        type: openshift
        config: "{{ providers.openshift }}"
        with:
          command_type: get_pods

    # Get OpenShift routes
    - name: get-routes
      provider:
        type: openshift
        config: "{{ providers.openshift }}"
        with:
          command_type: get_routes

  actions:
    # Display cluster summary
    - name: display-cluster-summary
      provider:
        type: console
        with:
          message: |
            🔍 OpenShift Cluster Summary:
            - Projects: {{ steps.get-projects.results | length }}
            - Total Pods: {{ steps.get-pods.results | length }}
            - Routes: {{ steps.get-routes.results | length }}

    # Show pod status for each namespace
    - name: display-pod-status
      foreach: "{{ steps.get-pods.results }}"
      provider:
        type: console
        with:
          message: "Pod: {{ foreach.value.metadata.name }} | Namespace: {{ foreach.value.metadata.namespace }} | Status: {{ foreach.value.status.phase }}"

    # List all projects
    - name: list-projects
      foreach: "{{ steps.get-projects.results }}"
      provider:
        type: console
        with:
          message: "Project: {{ foreach.value.metadata.name }} | Status: {{ foreach.value.status.phase | default('Active') }}"