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

# Mark test executions as stale

> Mark test executions as stale for the given devices, racks, and/or topology groups (topology groups include descendants, e.g. a pod covers every rack beneath it) — either an explicit test_slugs list (requires a note) or a stale-test operation slug resolved per device's device type. Every matching record gets an active stale hold, including records already stale from an earlier hold. Already-stale records keep their original marked_stale_at. Optionally restrict to executions completed before a given datetime (e.g. the timestamp of a firmware update or re-rack event). A manual call creates one TestExecutionStaleHold; an operation call creates one hold per touched device type so each hold retains the exact mapping snapshot used for that type. Every returned hold is independently reversible via its undo action.



## OpenAPI

````yaml /openapi/fleet-manager-openapi.yaml post /api/v1/burn-in/test-executions/mark-stale/
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/burn-in/test-executions/mark-stale/:
    post:
      tags:
        - Burn-in
      summary: Mark test executions as stale
      description: >-
        Mark test executions as stale for the given devices, racks, and/or
        topology groups (topology groups include descendants, e.g. a pod covers
        every rack beneath it) — either an explicit test_slugs list (requires a
        note) or a stale-test operation slug resolved per device's device type.
        Every matching record gets an active stale hold, including records
        already stale from an earlier hold. Already-stale records keep their
        original marked_stale_at. Optionally restrict to executions completed
        before a given datetime (e.g. the timestamp of a firmware update or
        re-rack event). A manual call creates one TestExecutionStaleHold; an
        operation call creates one hold per touched device type so each hold
        retains the exact mapping snapshot used for that type. Every returned
        hold is independently reversible via its undo action.
      operationId: api_v1_burn_in_test_executions_mark_stale_create
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TestExecutionMarkStale'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/TestExecutionMarkStale'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/TestExecutionMarkStale'
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TestExecutionMarkStaleResponse'
          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'
      security:
        - oauth2:
            - test-execution:mark_stale
        - cookieAuth: []
components:
  schemas:
    TestExecutionMarkStale:
      type: object
      description: >-
        Input serializer for the mark-stale bulk action.


        At least one of ``device_ids``, ``rack_ids``, ``topology_group_ids``, or

        ``topology_group_labels`` must be provided — every device they resolve
        to is

        unioned into a single target set.
        ``topology_group_ids``/``topology_group_labels``

        resolve a group and all of its descendants (e.g. a pod covers every
        rack/NVLink

        domain beneath it), matching the existing ``topology_group_id`` filter
        semantics

        used elsewhere in the API. ``rack_ids``/``topology_group_ids``/

        ``topology_group_labels`` expansions are restricted to host-kind
        devices, so a

        rack or pod containing a switch doesn't fail the whole call over a
        device type

        that was never meant to be targeted.


        Exactly one of ``test_slugs`` (manual) or ``operation`` (resolved from

        stale_test_operations.yaml, per device's device type) must be provided.
        Manual

        marks must include a ``note`` explaining why, since there's no operation
        label

        to carry that context — this is the "idiot proofing": a caller can't
        silently

        mass-invalidate records with no explanation.
      properties:
        device_ids:
          type: array
          items:
            type: string
            format: uuid
          description: Devices whose test records should be marked stale.
          minItems: 1
        rack_ids:
          type: array
          items:
            type: string
            format: uuid
          description: Mark stale every device in these racks, in addition to device_ids.
          minItems: 1
        topology_group_ids:
          type: array
          items:
            type: string
            format: uuid
          description: >-
            Mark stale every device in these topology groups and their
            descendants (e.g. a pod), in addition to device_ids/rack_ids.
            Topology group UUIDs are call-time only — a topology rebuild deletes
            and recreates groups with new UUIDs, so callers must resolve fresh
            IDs immediately before each call rather than caching them. Prefer
            topology_group_labels for anything that outlives a single request.
          minItems: 1
        topology_group_labels:
          type: array
          items:
            type: string
          description: >-
            Mark stale every device in these topology groups (resolved by label,
            scoped to site_id) and their descendants, in addition to the other
            target fields. Labels are stable across topology rebuilds, unlike
            topology_group_ids — prefer this field for anything a caller might
            store rather than resolve immediately before the call. Requires
            site_id.
          minItems: 1
        site_id:
          type: string
          format: uuid
          description: >-
            Required when topology_group_labels is provided, to resolve labels
            unambiguously.
        test_slugs:
          type: array
          items:
            type: string
          description: >-
            Test slugs to invalidate directly (e.g. 'single-node.hpl-cpu').
            Mutually exclusive with operation; requires note.
          minItems: 1
        operation:
          type: string
          description: >-
            A stale-test operation slug (e.g. 'node_reseat') from
            stale_test_operations.yaml. Resolved per device's device type into
            that operation's mapped test_slugs. Mutually exclusive with
            test_slugs. See GET /burn-in/stale-test-operations/ for the
            available operations.
          pattern: ^[-a-zA-Z0-9_]+$
        note:
          type: string
          default: ''
          description: >-
            Reason for this mark-stale action. Required when using test_slugs
            directly.
          maxLength: 1000
        stale_before:
          type: string
          format: date-time
          nullable: true
          description: >-
            Only mark executions completed before this datetime. Omit to target
            all matching records.
    TestExecutionMarkStaleResponse:
      type: object
      description: Response serializer for the mark-stale bulk action.
      properties:
        marked_stale_count:
          type: integer
          description: >-
            Number of test execution records attached to stale holds by this
            call.
        stale_hold_ids:
          type: array
          items:
            type: string
            format: uuid
          description: >-
            IDs of the TestExecutionStaleHold audit records created by this
            call, for later undo. One per device-type group actually touched;
            empty when nothing matched.
      required:
        - marked_stale_count
        - stale_hold_ids
    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'
    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
  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.