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

# Get device fault snapshot

> Return a consolidated fault/diagnosis snapshot for a device.

Accepts at most one of `job_id` or `test_execution_id` to scope the snapshot to a
specific failure; providing both is a 400. A `job_id` is accepted when the job has
either a status row or test-execution history for the device, and returns 404 only
when the job is unrelated to the device.

`ai_diagnosis` and `gate` are null when no failing job/device-status row is found.
A non-null `ai_diagnosis` whose `device_diagnosis`/`job_failure_summary` are both
null means a failing job was found but its AI analysis is not yet available.



## OpenAPI

````yaml /openapi/fleet-manager-openapi.yaml get /api/v1/devices/{id}/fault-snapshot/
openapi: 3.0.3
info:
  title: Fleet Manager API
  version: 1.0.0
  description: API for the Nscale Fleet Manager
servers: []
security: []
paths:
  /api/v1/devices/{id}/fault-snapshot/:
    get:
      tags:
        - Devices
      summary: Get device fault snapshot
      description: >-
        Return a consolidated fault/diagnosis snapshot for a device.


        Accepts at most one of `job_id` or `test_execution_id` to scope the
        snapshot to a

        specific failure; providing both is a 400. A `job_id` is accepted when
        the job has

        either a status row or test-execution history for the device, and
        returns 404 only

        when the job is unrelated to the device.


        `ai_diagnosis` and `gate` are null when no failing job/device-status row
        is found.

        A non-null `ai_diagnosis` whose `device_diagnosis`/`job_failure_summary`
        are both

        null means a failing job was found but its AI analysis is not yet
        available.
      operationId: api_v1_devices_fault_snapshot_retrieve
      parameters:
        - in: path
          name: id
          schema:
            type: string
            format: uuid
          description: A UUID string identifying this device.
          required: true
        - in: query
          name: job_id
          schema:
            type: string
            format: uuid
        - in: query
          name: test_execution_id
          schema:
            type: string
            format: uuid
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeviceFaultSnapshot'
          description: ''
        '400':
          description: Validation error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Authentication credentials were not provided or are invalid.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: You do not have permission to perform this action.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - oauth2:
            - device-fault-snapshot:read
        - cookieAuth: []
components:
  schemas:
    DeviceFaultSnapshot:
      type: object
      description: Consolidated device fault/diagnosis snapshot.
      properties:
        device_id:
          type: string
          format: uuid
        device_name:
          type: string
        resolved_job_id:
          type: string
          format: uuid
          nullable: true
        resolved_test_execution_id:
          type: string
          format: uuid
          nullable: true
        device_status:
          $ref: '#/components/schemas/DeviceStatusSection'
        recent_failed_tests:
          type: array
          items:
            $ref: '#/components/schemas/FailedTestExecution'
        pinned_test_execution:
          allOf:
            - $ref: '#/components/schemas/FailedTestExecution'
          nullable: true
          description: >-
            The explicitly requested test_execution_id payload when that pointer
            is a failure. Null when the request is not scoped by
            test_execution_id.
        active_execution:
          allOf:
            - $ref: '#/components/schemas/ActiveExecutionSection'
          nullable: true
          description: >-
            Newest running job/device-status row for the device. Null when no
            running execution is found in the requested scope.
        ai_diagnosis:
          allOf:
            - $ref: '#/components/schemas/AIDiagnosisSection'
          nullable: true
          description: >-
            Null when no failing job/device-status row is found. A non-null
            section with both device_diagnosis and job_failure_summary null
            means a failing job was found but its AI analysis is not yet
            available.
        gate:
          allOf:
            - $ref: '#/components/schemas/FailureGateSection'
          nullable: true
      required:
        - active_execution
        - ai_diagnosis
        - device_id
        - device_name
        - device_status
        - gate
        - pinned_test_execution
        - recent_failed_tests
        - resolved_job_id
        - resolved_test_execution_id
    ErrorResponse:
      type: object
      description: >-
        Uniform error body for every 4xx/5xx response. `detail` is a
        human-readable message, always present, safe to display to end users.
        `code` is the machine-readable identifier. `field_errors` lists
        per-input-field validation messages and is empty for non-field errors
        (auth, permission, not-found, conflict, server).
      required:
        - detail
        - code
        - field_errors
      properties:
        detail:
          type: string
        code:
          $ref: '#/components/schemas/ErrorCodeEnum'
        field_errors:
          type: array
          items:
            $ref: '#/components/schemas/FieldError'
    DeviceStatusSection:
      type: object
      description: Device status section of the fault snapshot.
      properties:
        operational_status:
          $ref: '#/components/schemas/DeviceOperationalStatusEnum'
        health_status:
          $ref: '#/components/schemas/DeviceHealthStatusEnum'
        inventory_status:
          $ref: '#/components/schemas/DeviceInventoryStatusEnum'
        operational_failure_reason:
          type: string
          nullable: true
        operational_failure_details:
          type: string
          nullable: true
      required:
        - health_status
        - inventory_status
        - operational_failure_details
        - operational_failure_reason
        - operational_status
    FailedTestExecution:
      type: object
      description: Failed test execution section of the fault snapshot.
      properties:
        id:
          type: string
          format: uuid
        job_id:
          type: string
          format: uuid
        cohort_id:
          type: string
          format: uuid
        test_slug:
          type: string
        stage:
          $ref: '#/components/schemas/StageEnum'
        status:
          $ref: '#/components/schemas/TestExecutionStatusEnum'
        evaluation:
          allOf:
            - $ref: '#/components/schemas/FaultSnapshotTestEvaluation'
          nullable: true
        error_details:
          allOf:
            - $ref: '#/components/schemas/FaultSnapshotBurnInErrorDetails'
          nullable: true
        started_at:
          type: string
          format: date-time
          nullable: true
        completed_at:
          type: string
          format: date-time
          nullable: true
        created_at:
          type: string
          format: date-time
      required:
        - cohort_id
        - completed_at
        - created_at
        - error_details
        - evaluation
        - id
        - job_id
        - stage
        - started_at
        - status
        - test_slug
    ActiveExecutionSection:
      type: object
      description: Currently running job/device execution section of the fault snapshot.
      properties:
        job_id:
          type: string
          format: uuid
        status:
          $ref: '#/components/schemas/JobDeviceStatusEnum'
        started_at:
          type: string
          format: date-time
          nullable: true
      required:
        - job_id
        - started_at
        - status
    AIDiagnosisSection:
      type: object
      description: AI diagnosis section of the fault snapshot.
      properties:
        device_diagnosis:
          allOf:
            - $ref: '#/components/schemas/FaultSnapshotAIDeviceDiagnosis'
          nullable: true
        job_failure_summary:
          allOf:
            - $ref: '#/components/schemas/FaultSnapshotAIJobFailureSummary'
          nullable: true
      required:
        - device_diagnosis
        - job_failure_summary
    FailureGateSection:
      type: object
      description: Failure-code triage gate section of the fault snapshot.
      properties:
        failure_code:
          type: string
          nullable: true
          description: >-
            ADR-0014 triage gate failure code from Fleet Manager workflow
            status. Unknown historical strings are preserved instead of coerced
            to the current taxonomy.
        responsible_team:
          allOf:
            - $ref: '#/components/schemas/ResponsibleTeamEnum'
          nullable: true
          description: >-
            ADR-0014 triage owner derived from failure_code. This is not CHAD's
            repair-domain taxonomy.
      required:
        - failure_code
        - responsible_team
    ErrorCodeEnum:
      type: string
      description: >-
        Stable machine-readable error identifier. New members may be added
        within this API version; clients must tolerate unknown values.
      enum:
        - error
        - invalid
        - parse_error
        - authentication_failed
        - not_authenticated
        - permission_denied
        - not_found
        - method_not_allowed
        - not_acceptable
        - unsupported_media_type
        - conflict
        - enrollment_infrastructure_reference_pending
        - enrollment_infrastructure_reference_changed
        - unprocessable_entity
        - throttled
        - service_unavailable
    FieldError:
      type: object
      description: One input field's validation messages.
      required:
        - field
        - messages
      properties:
        field:
          type: string
          description: >-
            Dotted path to the offending input field, or to the collection row
            when the whole row is invalid (e.g. `filters.end_date`,
            `memberships.0.role`, `memberships.0`).
        messages:
          type: array
          minItems: 1
          items:
            type: string
    DeviceOperationalStatusEnum:
      enum:
        - unknown
        - quarantine
        - validation
        - available
        - in_use
        - delegated
        - pending_handover
        - drained
        - failed
      type: string
      description: |-
        * `unknown` - Unknown
        * `quarantine` - Quarantine
        * `validation` - Validation
        * `available` - Available
        * `in_use` - In Use
        * `delegated` - Delegated
        * `pending_handover` - Pending Handover
        * `drained` - Drained
        * `failed` - Failed
    DeviceHealthStatusEnum:
      enum:
        - unknown
        - healthy
        - degraded
        - critical
      type: string
      description: |-
        * `unknown` - Unknown
        * `healthy` - Healthy
        * `degraded` - Degraded
        * `critical` - Critical
    DeviceInventoryStatusEnum:
      enum:
        - planned
        - staged
        - active
        - failed
        - offline
        - rma
        - returned
        - decommissioning
        - decommissioned
        - inventory
        - unknown
      type: string
      description: |-
        * `planned` - Planned
        * `staged` - Staged
        * `active` - Active
        * `failed` - Failed
        * `offline` - Offline
        * `rma` - RMA
        * `returned` - Returned
        * `decommissioning` - Decommissioning
        * `decommissioned` - Decommissioned
        * `inventory` - Inventory
        * `unknown` - Unknown
    StageEnum:
      enum:
        - single_node
        - pairwise
        - collective
      type: string
      description: |-
        * `single_node` - Single Node
        * `pairwise` - Pairwise
        * `collective` - Collective
    TestExecutionStatusEnum:
      enum:
        - completed
        - passed
        - failed
        - error
      type: string
      description: |-
        * `completed` - Completed
        * `passed` - Passed
        * `failed` - Failed
        * `error` - Error
    FaultSnapshotTestEvaluation:
      type: object
      description: OpenAPI schema for failed-test evaluation in a fault snapshot.
      properties:
        passed:
          type: boolean
        reason:
          type: string
          nullable: true
      required:
        - passed
        - reason
    FaultSnapshotBurnInErrorDetails:
      type: object
      description: OpenAPI schema for burn-in infrastructure error details.
      properties:
        message:
          type: string
          nullable: true
        debug_bundle_s3_uri:
          type: string
          nullable: true
        slurm_job_id:
          type: integer
          maximum: 2147483647
          minimum: 0
          nullable: true
      required:
        - debug_bundle_s3_uri
        - message
        - slurm_job_id
    JobDeviceStatusEnum:
      enum:
        - running
        - completed
        - failed
        - cancelled
        - terminated
        - superseded
        - timed_out
      type: string
      description: |-
        * `running` - Running
        * `completed` - Completed
        * `failed` - Failed
        * `cancelled` - Cancelled
        * `terminated` - Terminated
        * `superseded` - Superseded
        * `timed_out` - Timed Out
    FaultSnapshotAIDeviceDiagnosis:
      type: object
      description: Serializer for an AI device diagnosis embedded in a snapshot.
      properties:
        headline:
          type: string
          description: Concise, information-dense summary.
        explanation:
          type: string
          description: Structured device diagnosis explanation.
      required:
        - explanation
        - headline
    FaultSnapshotAIJobFailureSummary:
      type: object
      description: Serializer for an AI job failure summary embedded in a snapshot.
      properties:
        headline:
          type: string
          description: Concise job-level summary.
        explanation:
          type: string
          description: Narrative of what happened across devices.
        failure_categories:
          type: object
          additionalProperties:
            type: integer
          description: Map of failure category to count of affected devices.
      required:
        - explanation
        - failure_categories
        - headline
    ResponsibleTeamEnum:
      type: string
      enum:
        - fleet_manager
        - infra_eng
        - dc_eng
        - unknown
  securitySchemes:
    oauth2:
      type: oauth2
      flows: {}
    cookieAuth:
      type: apiKey
      in: cookie
      name: sessionid

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.