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

> List, retrieve, create and update racks.



## OpenAPI

````yaml /openapi/fleet-manager-openapi.yaml get /api/v1/racks/{id}/
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/racks/{id}/:
    get:
      tags:
        - Racks
      summary: Get rack
      description: List, retrieve, create and update racks.
      operationId: api_v1_racks_retrieve
      parameters:
        - in: path
          name: id
          schema:
            type: string
            format: uuid
          description: A UUID string identifying this rack.
          required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Rack'
          description: ''
        '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:
            - rack:read
        - cookieAuth: []
components:
  schemas:
    Rack:
      type: object
      description: Serializer for Rack model.
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
        annotations:
          type: object
          additionalProperties:
            type: string
          description: >-
            Key-value annotations. Keys must start with a lowercase letter and
            contain only lowercase alphanumeric segments joined by hyphens or
            underscores (e.g. 'org-id', 'gpu_ready').
        tags:
          type: array
          items:
            type: string
          description: >-
            Tags for the resource. Must start with a lowercase letter and
            contain only lowercase alphanumeric segments joined by hyphens or
            underscores (e.g. 'gpu-ready', 'needs_review'). Stored deduplicated
            and sorted.
        serial_number:
          type: string
          description: >-
            Rack serial number, sourced from NetBox by the netbox-agent
            reconciler. The reconciler is the sole automated writer; this field
            remains writable via the API as an operator-override escape hatch
            for manual correction (e.g. fixing a value before the next
            reconciliation cycle). See
            docs/specs/0007-fleet-1207-rack-serial-sync.md.
          maxLength: 50
        location_name:
          type: string
          readOnly: true
        site_name:
          type: string
          readOnly: true
        links:
          allOf:
            - $ref: '#/components/schemas/RackLinks'
          readOnly: true
        operational_status_counts:
          allOf:
            - $ref: '#/components/schemas/DeviceOperationalStatusCounts'
          readOnly: true
          description: >-
            Count of the rack's devices per operational status, every status
            present and defaulting to zero. Scoped to the rack's FM-managed
            devices excluding switches, so the Racks page can read these counts
            without fetching the whole site's operations/racks/standup payload.
            That endpoint selects the same class of device but scopes by site
            rather than by rack, so the two differ for a device whose site and
            rack.location.site have drifted apart. Deliberately narrower than a
            Site's counts.operational_status, which includes switches.
        device_count:
          type: integer
          readOnly: true
          description: >-
            Number of devices this rack's hostlists name. Carried explicitly so
            a caller need not derive it, matching device_count on the jobs list.
            It is the sum of operational_status_counts for every device holding
            a known status value; a row left on a retired status would be
            counted here and in no status bucket.
        triage_count:
          type: integer
          readOnly: true
          description: >-
            Number of the rack's devices currently in triage. Not derivable from
            triage_hostlist without expanding it, and a client needs the number
            to show "all" rather than a count.
        device_hostlist:
          type: string
          nullable: true
          readOnly: true
          description: >-
            Compressed hostlist of the rack's devices, over the same population
            as operational_status_counts. Empty string when the rack holds none.
            Null when the caller may not read device names — these name
            individual devices, so they need device:read on top of the rack:read
            this endpoint requires; the counts are unaffected.
        triage_hostlist:
          type: string
          nullable: true
          readOnly: true
          description: >-
            Compressed hostlist of the rack's devices currently in triage, a
            subset of device_hostlist. Empty string means nothing in the rack is
            in triage; null means the caller may not read device names, as for
            device_hostlist.
        created_at:
          type: string
          format: date-time
          readOnly: true
        updated_at:
          type: string
          format: date-time
          readOnly: true
        name:
          type: string
          maxLength: 255
        status:
          $ref: '#/components/schemas/RackStatusEnum'
        location:
          type: string
          format: uuid
        site:
          type: string
          format: uuid
          readOnly: true
      required:
        - created_at
        - device_count
        - device_hostlist
        - id
        - links
        - location
        - location_name
        - name
        - operational_status_counts
        - site
        - site_name
        - triage_count
        - triage_hostlist
        - updated_at
    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'
    RackLinks:
      type: object
      description: Serializer for rack links.
      properties:
        self:
          type: string
          format: uri
          readOnly: true
        collection:
          type: string
          format: uri
          readOnly: true
        location:
          type: string
          format: uri
          readOnly: true
        site:
          type: string
          format: uri
          readOnly: true
        devices:
          type: string
          format: uri
          readOnly: true
      required:
        - collection
        - devices
        - location
        - self
        - site
    DeviceOperationalStatusCounts:
      type: object
      description: Count of devices per operational status.
      properties:
        unknown:
          type: integer
        quarantine:
          type: integer
        validation:
          type: integer
        available:
          type: integer
        in_use:
          type: integer
        delegated:
          type: integer
        pending_handover:
          type: integer
        drained:
          type: integer
        failed:
          type: integer
      required:
        - available
        - delegated
        - drained
        - failed
        - in_use
        - pending_handover
        - quarantine
        - unknown
        - validation
    RackStatusEnum:
      enum:
        - reserved
        - available
        - planned
        - active
        - deprecated
        - unknown
      type: string
      description: |-
        * `reserved` - Reserved
        * `available` - Available
        * `planned` - Planned
        * `active` - Active
        * `deprecated` - Deprecated
        * `unknown` - Unknown
    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.