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

# List current and upcoming allocations per rack

> One site's floor: every rack, the non-expired allocations holding it, and its free devices.

Unpaginated and per rack rather than per allocation, because the caller is
drawing a floorplan: an allocation spanning three racks appears under each of
them with only that rack's devices, and a rack nothing holds is still present
with an empty list so the grid can colour it. Each rack also lists the devices
none of those allocations holds, so a partly allocated rack can be told apart.



## OpenAPI

````yaml /openapi/fleet-manager-openapi.yaml get /api/v1/allocations/current/
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/allocations/current/:
    get:
      tags:
        - Allocations
      summary: List current and upcoming allocations per rack
      description: >-
        One site's floor: every rack, the non-expired allocations holding it,
        and its free devices.


        Unpaginated and per rack rather than per allocation, because the caller
        is

        drawing a floorplan: an allocation spanning three racks appears under
        each of

        them with only that rack's devices, and a rack nothing holds is still
        present

        with an empty list so the grid can colour it. Each rack also lists the
        devices

        none of those allocations holds, so a partly allocated rack can be told
        apart.
      operationId: api_v1_allocations_current_retrieve
      parameters:
        - in: query
          name: site_id
          schema:
            type: string
            format: uuid
          description: Site ID used to constrain the unpaginated compact response.
          required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CurrentAllocations'
          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:
            - allocation:read
        - cookieAuth: []
components:
  schemas:
    CurrentAllocations:
      type: object
      description: Response shape of the current-allocations read.
      properties:
        site_id:
          type: string
          format: uuid
        rack_position_strategy:
          allOf:
            - $ref: '#/components/schemas/RackPositionStrategyEnum'
          description: >-
            How every `position` and `row` in this response was determined.
            Reported once because it is a property of the site, and it tells a
            caller whether the placement is authoritative or inferred from
            operator naming. The same value the standup racks endpoint reports
            for this site.


            * `derived_from_name` - DERIVED_FROM_NAME

            * `derived_from_scalable_unit` - DERIVED_FROM_SCALABLE_UNIT
        racks:
          type: array
          items:
            $ref: '#/components/schemas/CurrentAllocationRack'
      required:
        - rack_position_strategy
        - racks
        - site_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'
    RackPositionStrategyEnum:
      enum:
        - derived_from_name
        - derived_from_scalable_unit
      type: string
      description: |-
        * `derived_from_name` - DERIVED_FROM_NAME
        * `derived_from_scalable_unit` - DERIVED_FROM_SCALABLE_UNIT
    CurrentAllocationRack:
      type: object
      description: >-
        A rack, the non-expired allocations holding devices in it, and the
        devices none holds.
      properties:
        rack_id:
          type: string
          format: uuid
        rack_name:
          type: string
        location_id:
          type: string
          format: uuid
          description: >-
            The rack's `Location` — the hall row, at sites that model rows.
            Group racks by this rather than by `location_name`: a site can hold
            two rows sharing a name, and they are different rows.
        location_name:
          type: string
        row:
          type: integer
          minimum: 1
          nullable: true
          description: >-
            The row's rank across the site, read off `location_name` — `Row B`
            reports 2. Pairs with `position` to place a rack on a grid: `(2,
            10)` is row B, slot 10. An absolute ordinal, not a dense 1..N index,
            so a site whose rows jump `Row D` to `Row F` reports 4 then 6 and
            lane 5 is yours to draw or close. Null for every rack when the
            site's rows cannot be told apart. See `rack_position_strategy`.
        position:
          type: integer
          minimum: 1
          nullable: true
          description: >-
            The rack's slot along its row — `A10` reports 10, so it sorts after
            `A9` and before `A11`. The absolute number read off the rack name,
            not a dense 1..N index, so an unoccupied slot leaves a hole; only
            comparable within one `location_id`. Null when the slot cannot be
            determined. See `rack_position_strategy`.
        allocations:
          type: array
          items:
            $ref: '#/components/schemas/RackAllocation'
          description: >-
            Every non-expired allocation holding devices in this rack, including
            ones that have not started yet: a lease that starts next week
            already books the rack. Narrow on `start_at` for today's holders.
            One device can sit under more than one entry, one after another but
            never at the same time, so count distinct ids.
        unallocated:
          type: array
          items:
            type: string
            format: uuid
          description: >-
            Devices in this rack that no entry in `allocations` holds, on the
            same non-expired basis: a device whose only allocation starts in the
            future is allocated, not unallocated. Both lists count the devices
            `device-candidates` offers: every FM-managed device recorded at this
            site, switches included, customer-ready or not, so RMA, staged and
            offline devices and spares count here as unallocated;
            `device-candidates` marks those `not_customer_ready`. Inventory-only
            devices cannot be allocated and appear in neither. The two lists
            never overlap and together cover every such device in the rack, but
            one device can sit under more than one allocation, so count distinct
            ids. Empty when the rack is fully allocated or holds no devices.
      required:
        - allocations
        - location_id
        - location_name
        - position
        - rack_id
        - rack_name
        - row
        - unallocated
    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
    RackAllocation:
      type: object
      description: One allocation's hold on one rack.
      properties:
        allocation_id:
          type: string
          format: uuid
        tenant_id:
          type: string
          format: uuid
        tenant_name:
          type: string
        start_at:
          type: string
          format: date-time
        end_at:
          type: string
          format: date-time
        device_ids:
          type: array
          items:
            type: string
            format: uuid
          description: Only this allocation's devices in this rack.
      required:
        - allocation_id
        - device_ids
        - end_at
        - start_at
        - tenant_id
        - tenant_name
  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.