Inventory & stock

Hardware parts across all servers and in stock (spare, defective, RMA, retired).

7 endpoints

List hardware parts

#

GET/api/v1/inventory

Admin only

Installed parts and stock. Filters: component, status (installed, spare, defective, rma, retired, or stock for everything not installed), siteId, search; paged with page and perPage.

Query parameters

  • component stringone of cpu, memory, disk, mainboard, nic, gpu, psu, other
  • status stringone of installed, spare, defective, rma, retired, stock
  • siteId integer | stringone of none, > 0
  • search stringmax. 100 chars
  • page integer≥ 1, default 1
  • perPage integer≥ 1, ≤ 1000, default 100

Example

curl "https://panel.example.com/api/v1/inventory" \
  -H "Authorization: Bearer $TRIXOS_TOKEN"

Add a part

#

POST/api/v1/inventory

Admin only

Usually a stock part (spare by default). A part with serverId is installed in that server.

Request body

  • componentstringrequired

    one of cpu, memory, disk, mainboard, nic, gpu, psu, other

  • modelstring

    max. 200 chars, default ""

  • valuestring

    max. 100 chars, default ""

  • unitstring

    max. 20 chars, default ""

  • serialstring | null

    max. 100 chars

  • statusstring

    one of installed, spare, defective, rma, retired, default "spare"

  • serverIdinteger | null

    > 0

  • siteIdinteger | null

    > 0

  • notesstring

    max. 2000 chars, default ""

Example

curl -X POST "https://panel.example.com/api/v1/inventory" \
  -H "Authorization: Bearer $TRIXOS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"component":"disk","model":"Samsung PM883 960GB","value":"915715","unit":"MiB","serial":"S4ENNF0M123456","status":"spare","siteId":1}'

Update a part

#

PATCH/api/v1/inventory/{id}

Admin only

Change the status (for example to rma), the location, or install it in a server.

Path parameters

  • id integer> 0

Request body

  • componentstring

    one of cpu, memory, disk, mainboard, nic, gpu, psu, other

  • modelstring

    max. 200 chars

  • valuestring

    max. 100 chars

  • unitstring

    max. 20 chars

  • serialstring | null

    max. 100 chars

  • statusstring

    one of installed, spare, defective, rma, retired

  • serverIdinteger | null

    > 0

  • siteIdinteger | null

    > 0

  • notesstring

    max. 2000 chars

Example

curl -X PATCH "https://panel.example.com/api/v1/inventory/42" \
  -H "Authorization: Bearer $TRIXOS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"status":"rma"}'

Delete a part

#

DELETE/api/v1/inventory/{id}

Admin only

Path parameters

  • id integer> 0

Example

curl -X DELETE "https://panel.example.com/api/v1/inventory/42" \
  -H "Authorization: Bearer $TRIXOS_TOKEN"

Spare parts in stock

#

GET/api/v1/inventory/stock

Admin only

Spare parts without a server; with serverId, those stored at that server’s datacenter or without a datacenter.

Query parameters

  • serverId integer> 0

Example

curl "https://panel.example.com/api/v1/inventory/stock" \
  -H "Authorization: Bearer $TRIXOS_TOKEN"

Which servers have hardware data and where it came from

#

GET/api/v1/inventory/coverage

Admin only

How complete the hardware data is: servers with CPU / memory / disk data, by where it came from (OS scan, BMC, TenantOS import, entered by hand), and the servers without any, with whether their BMC can be read.

Example

curl "https://panel.example.com/api/v1/inventory/coverage" \
  -H "Authorization: Bearer $TRIXOS_TOKEN"

Read the hardware of several servers from their BMCs (background, read-only)

#

POST/api/v1/inventory/bmc-read

Admin only

Read the hardware of several servers from their BMCs (read-only, same as "Read from BMC" on a server): in the background, 4 at a time, each limited to 2 minutes; the coverage shows progress. Per component, data from an OS scan, the import or entered by hand is kept.

Request body

  • serverIdsinteger[]required

    min. 1 items, max. 500 items

Example

curl -X POST "https://panel.example.com/api/v1/inventory/bmc-read" \
  -H "Authorization: Bearer $TRIXOS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"serverIds":[1]}'