> ## Documentation Index
> Fetch the complete documentation index at: https://chatcli.edilsonfreitas.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Obter Remediação do Incidente

> Retorna o plano de remediação e seu status de execução para um incidente

<ParamField path="name" type="string" required>
  Nome único do incidente (ex: `INC-20260319-001`)
</ParamField>

<ResponseExample>
  ```json Response 200 theme={"system"}
  {
    "apiVersion": "v1",
    "kind": "Remediation",
    "metadata": {
      "name": "INC-20260319-001",
      "namespace": "production"
    },
    "spec": {
      "runbook": "runbook-oomkill-standard",
      "strategy": "automated",
      "approvalRequired": true,
      "rollbackOnFailure": true
    },
    "status": {
      "phase": "PendingApproval",
      "steps": [
        {
          "name": "diagnose-memory-usage",
          "description": "Coletar métricas de uso de memória do container",
          "status": "Completed",
          "startedAt": "2026-03-19T15:20:30Z",
          "completedAt": "2026-03-19T15:20:45Z",
          "output": "Uso médio: 498Mi/512Mi (97.2%)"
        },
        {
          "name": "patch-resource-limits",
          "description": "Atualizar memory limit do Deployment para 1Gi",
          "status": "PendingApproval",
          "approvalName": "APR-20260319-001"
        },
        {
          "name": "verify-stability",
          "description": "Verificar estabilidade do pod após patch",
          "status": "Pending"
        },
        {
          "name": "update-hpa",
          "description": "Ajustar HPA para nova configuração de recursos",
          "status": "Pending"
        }
      ],
      "estimatedDuration": "5m",
      "riskLevel": "medium",
      "preflightSnapshot": {
        "resourceKind": "Deployment",
        "resourceName": "checkout-service",
        "namespace": "production",
        "replicas": 3,
        "containerImages": {"app": "ghcr.io/myorg/checkout:v2.1.0"},
        "containerResources": {
          "app": {"cpuRequest": "200m", "cpuLimit": "1000m", "memoryRequest": "256Mi", "memoryLimit": "512Mi"}
        },
        "hpaMinReplicas": 2,
        "hpaMaxReplicas": 8,
        "capturedAt": "2026-03-19T15:20:25Z"
      },
      "actionCheckpoints": [
        {"actionIndex": 0, "actionType": "diagnose-memory-usage", "success": true, "timestamp": "2026-03-19T15:20:30Z"},
        {"actionIndex": 1, "actionType": "patch-resource-limits", "success": false, "timestamp": "2026-03-19T15:20:50Z"}
      ],
      "rollbackPerformed": false,
      "postFailureHealthy": null
    }
  }
  ```
</ResponseExample>

<ResponseExample>
  ```json Response 404 theme={"system"}
  {
    "apiVersion": "v1",
    "kind": "Error",
    "error": {
      "code": 404,
      "message": "Remediação não encontrada",
      "details": "Nenhum plano de remediação foi gerado para o incidente 'INC-20260319-001'"
    }
  }
  ```
</ResponseExample>


## OpenAPI

````yaml GET /incidents/{name}/remediation
openapi: 3.1.0
info:
  title: ChatCLI AIOps Platform API
  description: >-
    REST API for the ChatCLI AIOps Platform — incidents, SLOs, runbooks,
    approvals, postmortems, analytics, audit, federation and health.


    The playground below uses **editable server variables** so you can point
    requests at your own self-hosted instance. Adjust `host`, `port` and
    `basePath` to match your deployment, then click **Try it**.
  version: 1.0.0
  contact:
    name: ChatCLI
    url: https://github.com/diillson/chatcli
  license:
    name: Apache-2.0
    identifier: Apache-2.0
servers:
  - url: http://{host}:{port}/{basePath}
    description: >-
      Self-hosted ChatCLI AIOps Platform — adjust host, port and basePath to
      match your deployment.
    variables:
      host:
        default: localhost
        description: >-
          Hostname or IP of your ChatCLI operator. For Kubernetes, use the
          Service DNS (e.g. chatcli-api.chatcli-system.svc) or your Ingress
          host.
      port:
        default: '8090'
        description: >-
          Port the API listens on. Default is 8090; configurable via Helm value
          `apiPort` or env var CHATCLI_API_PORT.
      basePath:
        default: api/v1
        description: >-
          API base path. Always `api/v1` unless you have a custom proxy rewrite
          in front of the operator.
security:
  - ApiKeyAuth: []
tags:
  - name: Incidents
    description: >-
      Incident lifecycle: list, fetch, acknowledge, resolve, snooze, timeline
      and remediation views.
  - name: Runbooks
    description: Remediation runbooks (list, create, update, delete).
  - name: SLOs
    description: Service Level Objectives and error budgets.
  - name: Approvals
    description: Approval workflow for risky remediations.
  - name: Postmortems
    description: Auto-generated postmortems with review, feedback and close.
  - name: Remediations
    description: Remediation plans and agentic execution history.
  - name: AI Insights
    description: AI root-cause analysis and recommendations per incident.
  - name: Analytics
    description: 'Operational analytics: MTTD, MTTR, trends, capacity, compliance.'
  - name: Audit
    description: Immutable audit log and exports.
  - name: Federation
    description: 'Multi-cluster federation: clusters, status and cross-cluster correlations.'
  - name: Health
    description: Liveness and readiness probes.
paths:
  /incidents/{name}/remediation:
    get:
      tags:
        - Incidents
      summary: Get Incident Remediation
      description: Returns the remediation plan and execution status for a given incident.
      operationId: getRemediation
      parameters:
        - name: name
          in: path
          required: true
          description: Unique incident name.
          schema:
            type: string
            example: INC-20260319-001
      responses:
        '200':
          description: Remediation plan and live status
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Remediation'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/RateLimited'
components:
  schemas:
    Remediation:
      type: object
      properties:
        apiVersion:
          type: string
          example: v1
        kind:
          type: string
          example: Remediation
        metadata:
          type: object
          properties:
            name:
              type: string
            namespace:
              type: string
        spec:
          type: object
          properties:
            runbook:
              type: string
            strategy:
              type: string
            approvalRequired:
              type: boolean
            rollbackOnFailure:
              type: boolean
        status:
          type: object
          properties:
            phase:
              type: string
              example: PendingApproval
            steps:
              type: array
              items:
                $ref: '#/components/schemas/RemediationStep'
            estimatedDuration:
              type: string
            riskLevel:
              type: string
            preflightSnapshot:
              type: object
              additionalProperties: true
            actionCheckpoints:
              type: array
              items:
                type: object
                properties:
                  actionIndex:
                    type: integer
                  actionType:
                    type: string
                  success:
                    type: boolean
                  timestamp:
                    type: string
                    format: date-time
            rollbackPerformed:
              type: boolean
            postFailureHealthy:
              type:
                - boolean
                - 'null'
    RemediationStep:
      type: object
      properties:
        name:
          type: string
        description:
          type: string
        status:
          type: string
          example: Completed
        startedAt:
          type: string
          format: date-time
        completedAt:
          type: string
          format: date-time
        output:
          type: string
        approvalName:
          type: string
    Error:
      type: object
      required:
        - apiVersion
        - kind
        - error
      properties:
        apiVersion:
          type: string
          example: v1
        kind:
          type: string
          example: Error
        error:
          oneOf:
            - type: object
              required:
                - code
                - message
              properties:
                code:
                  type: integer
                  example: 404
                message:
                  type: string
                  example: Resource not found
                details:
                  type: string
            - type: string
        code:
          type: integer
          description: Top-level code (only used by some endpoints).
          example: 400
  responses:
    Unauthorized:
      description: Missing or invalid API token
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFound:
      description: Resource not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    RateLimited:
      description: Rate limit exceeded for this token's role
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: Authorization
      description: >-
        Bearer token issued by the operator. Format: `Authorization: Bearer
        <token>`.

````