> ## 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 Cluster

> Retorna detalhes de um cluster federado específico, incluindo status de saúde, contagem de nós, uso de recursos e incidentes ativos

<ParamField path="name" type="string" required>
  Nome único de registro do cluster
</ParamField>

<ParamField query="namespace" type="string" default="default">
  Namespace do Kubernetes onde o CR ClusterRegistration reside
</ParamField>

<ResponseExample>
  ```json Response 200 theme={"system"}
  {
    "apiVersion": "v1",
    "kind": "ClusterRegistration",
    "metadata": {
      "name": "production-us-east-1",
      "namespace": "chatcli-system",
      "createdAt": "2026-01-15T10:00:00Z"
    },
    "spec": {
      "displayName": "Production US East 1",
      "kubeconfigSecret": "cluster-prod-us-east-1-kubeconfig",
      "tier": "production",
      "region": "us-east-1"
    },
    "status": {
      "phase": "Connected",
      "lastHealthCheck": "2026-03-19T15:00:00Z",
      "kubernetesVersion": "v1.31.2",
      "nodeCount": 12,
      "namespaceCount": 25,
      "activeIssues": 2,
      "activeRemediations": 1,
      "resourceUsage": {
        "cpuCapacity": "48",
        "cpuUsed": "31.2",
        "memoryCapacity": "192Gi",
        "memoryUsed": "124Gi"
      }
    }
  }
  ```
</ResponseExample>

<ResponseExample>
  ```json Response 404 theme={"system"}
  {
    "apiVersion": "v1",
    "kind": "Error",
    "error": {
      "code": 404,
      "message": "Cluster not found",
      "details": "No cluster registration named 'production-us-east-1' found"
    }
  }
  ```
</ResponseExample>


## OpenAPI

````yaml GET /clusters/{name}
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:
  /clusters/{name}:
    get:
      tags:
        - Federation
      summary: Get Cluster
      description: >-
        Returns details of a specific federated cluster, including health
        status, node count, resource usage and active incidents.
      operationId: getCluster
      parameters:
        - name: name
          in: path
          required: true
          description: Unique registration name of the cluster.
          schema:
            type: string
            example: production-us-east-1
        - name: namespace
          in: query
          required: false
          description: Kubernetes namespace where the ClusterRegistration CR resides.
          schema:
            type: string
            default: default
      responses:
        '200':
          description: Cluster found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClusterRegistration'
              example:
                apiVersion: v1
                kind: ClusterRegistration
                metadata:
                  name: production-us-east-1
                  namespace: chatcli-system
                  createdAt: '2026-01-15T10:00:00Z'
                spec:
                  displayName: Production US East 1
                  kubeconfigSecret: cluster-prod-us-east-1-kubeconfig
                  tier: production
                  region: us-east-1
                status:
                  phase: Connected
                  lastHealthCheck: '2026-03-19T15:00:00Z'
                  kubernetesVersion: v1.31.2
                  nodeCount: 12
                  namespaceCount: 25
                  activeIssues: 2
                  activeRemediations: 1
                  resourceUsage:
                    cpuCapacity: '48'
                    cpuUsed: '31.2'
                    memoryCapacity: 192Gi
                    memoryUsed: 124Gi
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          description: Cluster not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                apiVersion: v1
                kind: Error
                error:
                  code: 404
                  message: Cluster not found
                  details: No cluster registration named 'production-us-east-1' found
        '429':
          $ref: '#/components/responses/RateLimited'
components:
  schemas:
    ClusterRegistration:
      type: object
      required:
        - apiVersion
        - kind
        - metadata
        - spec
      properties:
        apiVersion:
          type: string
          example: v1
        kind:
          type: string
          example: ClusterRegistration
        metadata:
          type: object
          properties:
            name:
              type: string
            namespace:
              type: string
            createdAt:
              type: string
              format: date-time
        spec:
          type: object
          properties:
            displayName:
              type: string
            kubeconfigSecret:
              type: string
            tier:
              type: string
              enum:
                - production
                - staging
                - development
                - critical
                - standard
                - non-critical
            region:
              type: string
        status:
          type: object
          properties:
            phase:
              type: string
              enum:
                - Connected
                - Disconnected
                - Pending
                - Error
            lastHealthCheck:
              type: string
              format: date-time
            kubernetesVersion:
              type: string
            nodeCount:
              type: integer
            namespaceCount:
              type: integer
            activeIssues:
              type: integer
            activeRemediations:
              type: integer
            resourceUsage:
              $ref: '#/components/schemas/ResourceUsage'
    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
    ResourceUsage:
      type: object
      properties:
        cpuCapacity:
          type: string
          example: '48'
        cpuUsed:
          type: string
          example: '31.2'
        memoryCapacity:
          type: string
          example: 192Gi
        memoryUsed:
          type: string
          example: 124Gi
  responses:
    Unauthorized:
      description: Missing or invalid API token
      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>`.

````