> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.nvidia.com/dsx-air/llms.txt.

# List devices

GET https://api.dsx-air.nvidia.com/api/v3/simulations/devices/

List devices (e.g. NICs) in a simulation.

**Required scope:** Simulation Read (roles: Air Org Administrator, Air User)

**Alternative:** the Air Trainee role also grants access.

Reference: https://docs.nvidia.com/dsx-air/api-reference/devices/api-v-3-simulations-devices-list

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Request

### Query parameters

- `limit` (integer, optional) — Number of results to return per page.
- `name` (string, optional)
- `offset` (integer, optional) — The initial index from which to return the results.
- `ordering` (enum, optional) — Order the results by this field. Prefix with `-` for descending order. Default: `created`.
  - Allowed values: `-created`, `-modified`, `-name`, `created`, `modified`, `name`
- `parent` (string, optional) — Only the devices plugged into this node.
- `search` (string, optional) — Search by `name`.
- `simulation` (string, optional) — Only this simulation's devices.

## Response

### 200

- `count` (integer, required)
- `results` (list of DeviceRead, required)
- `next` (string, optional, nullable)
- `previous` (string, optional, nullable)

## Errors

### 400 Bad Request Error

- `detail` (string, required) — Description of an error.
- `request_id` (string, required, nullable) — ID assigned to the request which encountered the error. Should be provided when opening a support case.
- `type` (enum, required) — Specific type of a 400 error. * `PROTECTED` - Instance may not be deleted as it is being referenced by other instances. * `VALIDATION` - Validation errors encountered during payload processing.
  - Allowed values: `PROTECTED`, `VALIDATION`
- `protected_instances` (list of ProtectedErrorInstance, optional) — Instances which bar the current instance from being deleted. Only defined when `type` is set to `PROTECTED`.
- `validation_errors` (BadRequestValidationErrors, optional) — Validation errors encountered during payload processing. Only defined when `type` is set to `VALIDATION`.

### 403 Forbidden Error

- `detail` (string, required) — Description of an error.
- `request_id` (string, required, nullable) — ID assigned to the request which encountered the error. Should be provided when opening a support case.

### 500 Internal Server Error

- `request_id` (string, required, nullable) — ID assigned to the request which encountered the error. Should be provided when opening a support case.
- `code` (string, required) — Error code which identifies the error. Should be provided when opening a support case.
- `detail` (string, optional, default: An unexpected error has occurred. Please contact NVIDIA Air support for further assistance.) — Description of an error.

## Types

### DeviceRead

Read representation of a device (e.g. a NIC) attached to an emulated node.

- `id` (string, required)
- `created` (datetime, required)
- `modified` (datetime, required)
- `name` (string, required) — Name of this device. Must be unique across all devices on the same parent node. This name is delivered to the simulator to indicate a unique name and which interfaces are connected to it.
- `emulation_type` (string, required) — The emulation type of this device (e.g. `NIC_ETHERNET`).
- `model` (string, required) — The hardware model this device emulates (e.g. `connectx7`).
- `number_of_ports` (integer, required, nullable) — The number of ports this device emulates. Resolved at create, so it can differ from what was requested. `null` when the platform declares no port count.
- `port_type` (string, required, nullable) — The port type this device emulates (e.g. `ethernet`). `null` when neither the request nor the model's default set one.
- `default_split` (string, required, nullable) — The port split override this device was created with. `null` for a device with no OS of its own, and when it uses the platform's own default split.
- `parent` (string, required) — The `id` of the emulated node this device is plugged into.
- `pci_config` (DevicePciConfig, required) — The PCI slot this device occupies on its parent node.
- `vm_config` (DeviceVmConfigReadField, required) — The node this device runs. Empty for emulated hardware which boots no operating system of its own.
- `simulator_config` (map from string to any, required) — Simulator-engine configuration for this device. The service-derived keys (`model`, `number_of_ports`, `port_type`, `pci_address`, `pci_index`) are excluded - they surface as their own fields.
- `has_os` (boolean, required) — Whether this device boots an operating system of its own (e.g. a DPU), rather than being emulated hardware with no OS to run (e.g. a NIC). Tells which children accept instructions, resets and console access.

### ProtectedErrorInstance

Identifier of a protected instance.

- `id` (string, required) — ID of the instance.
- `type` (string, required) — Type of the instance.

### BadRequestValidationErrors

Validation errors encountered during payload processing. Only defined when `type` is set to `VALIDATION`.

- map from string to BadRequestValidationErrorsOneOf0
- list of BadRequestValidationErrorsOneOf1Items

### DevicePciConfig

The PCI slot a device occupies on its parent node.

- `pci_address` (string, optional) — Address of this device on its parent, in BDF notation (e.g. `0000:1a:00.0`). Auto-assigned to the next free slot when omitted.

### DeviceVmConfigReadField

Renders the node a device runs, or an empty block when it has none.

- `image` (string, required) — The image representing the operating system of the node.
- `cloud_init` (CloudInitAssignment, required) — Cloud-Init assignment for this node, if any.
- `console_password` (string, required) — The password used when signing into a node using the Web UI console as well as the VNC console.
- `cpu` (integer, optional) — Number of CPU cores.
- `memory` (integer, optional) — RAM, in MiB.
- `storage` (integer, optional) — Primary boot disk space, in GB.
- `pos_x` (integer, optional) — The horizontal coordinate position in the UI.
- `pos_y` (integer, optional) — The vertical coordinate position in the UI.
- `labels` (NodeAttributes, optional) — Labels which can be specified on the node. Fields not specified in the payload schema will be completely ignored. If updating, the data provided will completely replace existing labels: attempting to PATCH specific labels will delete the other labels.
- `metadata` (string, optional, nullable) — Custom metadata as a JSON string. This field does not affect the runtime of the node or simulation. It is provided for clients to store metadata about the node for their own purposes.
- `advanced` (NodeAdvancedField, optional) — Advanced configuration associated with the node.
- `cdrom` (CDROMAssignment, optional, nullable) — CD-ROM assignment for this node. Provide `{"image": <id>}` to attach or replace the CD-ROM image, or `null` to eject.
- `storage_pci` (map from string to TopologyFormatStoragePCIField, optional, nullable) — Storage PCI elements associated with the node.
- `management_interfaces` (map from string to ManagementInterfaceEntry, optional) — Dict mapping interface names (e.g. "eth0", "eth1") to management address info with optional keys "ip" (IPv4) and "mac_address". Mutually exclusive with management_ip and management_mac.

### BadRequestValidationErrorsOneOf0

- list of BadRequestValidationErrorsOneOf0OneOf0Items
- BadRequestValidationErrorsOneOf01
- map from string to any

### BadRequestValidationErrorsOneOf1Items

A single validation error.

- `message` (string, required) — Human-readable description of the error.
- `code` (string, required) — Machine-readable identifier for the error, for branching in client code. DRF supplies the default (e.g. `invalid`, `required`, `unique`); Air sets its own where a generic code would hide the cause, such as `protected` when a delete is refused because another instance still references this one.

### CloudInitAssignment

Assignment of Cloud-Init configs for a specific node. This can be used as a NoCloud data source.

- `user_data_name` (string, required) — Name of the assigned user-data config.
- `meta_data_name` (string, required) — Name of the assigned meta-data config.
- `user_data` (string, optional, nullable) — User data config to assign to the node. Supported MIME types are based on the operating system's `cloud-init` service version.
- `meta_data` (string, optional, nullable) — Meta data config to assign to the node (specific to NoCloud datasource).

### NodeAttributes

Node labels exposed in the API, stored internally as `attributes`.

- `group` (string, optional) — The group of the node.
- `model` (string, optional) — The model of the node.
- `sku` (string, optional) — The SKU of the node.
- `rack_name` (string, optional) — The name of the rack the node is part of.
- `rack_unit` (integer, optional) — The unit number within a rack for the node.
- `scalable_unit` (integer, optional) — The scalable unit number that the node belongs to.
- `rail_index` (integer, optional) — The rail index that the node belongs to.
- `data_hall` (string, optional) — The name of the data hall that the node is part of.
- `tray_index` (integer, optional) — The tray index of the node.
- `role` (string, optional) — The role of the node, e.g. leaf.
- `pod` (integer, optional) — The pod number that the node belongs to.
- `superspine_group` (integer, optional) — The superspine group number that the node belongs to.
- `plane_id` (integer, optional) — Plane identifier in a multi-plane fabric.

### NodeAdvancedField

Advanced configuration associated with the node.

- `nic_model` (enum, optional, default: virtio) — Indicates the model to use for the node's network interfaces. * `virtio` - VirtIO * `e1000` - Intel E1000
  - Allowed values: `virtio`, `e1000`
- `cpu_mode` (enum, optional, default: custom) — Indicates the CPU mode of the node. Can only be set for entities without an `emulation_type` set. * `custom` - Custom CPU mode which can include custom CPU options. * `host-model` - CPU mode which attempts to select a CPU model resembling the hypervisor's CPU model as closely as possible. * `host-passthrough` - CPU mode which exposes all details of the hypervisor's CPU model.
  - Allowed values: `custom`, `host-model`, `host-passthrough`
- `cpu_options` (list of enum, optional) — Indicates the CPU options of the node. CPU mode must be set to `custom` for CPU options to be used. Can only be set for entities without an `emulation_type` set.
  - Allowed values: `ssse3`, `sse4.1`, `sse4.2`, `popcnt`
- `secureboot` (boolean, optional, default: false) — Indicates whether the node should perform a SecureBoot. UEFI must be enabled for SecureBoot to be used. Can only be set for entities without an `emulation_type` set.
- `uefi` (boolean, optional, default: false) — Indicates whether the node should use UEFI. Can only be set for entities without an `emulation_type` set.
- `boot` (list of enum, optional, default: hd) — Indicates how the node should boot. Accepts either a single device (legacy form, e.g. 'hd' or 'network') or a list of 1..3 unique devices for ordered fall-through (e.g. ['hd', 'network']).
  - Allowed values: `hd`, `network`, `cdrom`

### CDROMAssignment

Assignment of a CD-ROM image to a node.

- `image` (string, required) — Image to insert into the node CD-ROM drive.

### TopologyFormatStoragePCIField

Serializer for the `StoragePCI` field.

- `type` (enum, required) — Type of the storage PCI device * `NVME` - NVMe SSD Drive
  - Allowed values: `NVME`
- `size` (integer, required) — Size of the storage PCI device in GB
- `name` (string, optional) — Name of the storage PCI device. If not provided, a default name will be assigned in the format `nvme-<index+1>`. The name must contain only letters, numbers, and hyphens and be less than 20 characters

### ManagementInterfaceEntry

An entry in the `management_interfaces` PATCH dict.

- `ip` (string, required, nullable) — IPv4 address for this management interface on the OOB network. Must be within 192.168.0.0/16 and not end in .255 (broadcast). Set to `null` to opt this interface out of OOB-managed DHCP (interface is still wired to the leaf switch, but no ManagementAddress or dhcpd host entry is created).
- `mac_address` (string, required) — Unicast MAC address for this management interface.

### BadRequestValidationErrorsOneOf0OneOf0Items

A single validation error.

- `message` (string, required) — Human-readable description of the error.
- `code` (string, required) — Machine-readable identifier for the error, for branching in client code. DRF supplies the default (e.g. `invalid`, `required`, `unique`); Air sets its own where a generic code would hide the cause, such as `protected` when a delete is refused because another instance still references this one.

### BadRequestValidationErrorsOneOf01

A single validation error.

- `message` (string, required) — Human-readable description of the error.
- `code` (string, required) — Machine-readable identifier for the error, for branching in client code. DRF supplies the default (e.g. `invalid`, `required`, `unique`); Air sets its own where a generic code would hide the cause, such as `protected` when a delete is refused because another instance still references this one.

## Examples

**Response**

```json
{
  "count": 123,
  "results": [
    {
      "id": "string",
      "created": "2024-01-15T09:30:00Z",
      "modified": "2024-01-15T09:30:00Z",
      "name": "string",
      "emulation_type": "string",
      "model": "string",
      "number_of_ports": 1,
      "port_type": "string",
      "default_split": "string",
      "parent": "string",
      "pci_config": {
        "pci_address": "string"
      },
      "vm_config": {
        "image": "string",
        "cloud_init": {
          "user_data_name": "string",
          "meta_data_name": "string",
          "user_data": "string",
          "meta_data": "string"
        },
        "console_password": "string",
        "cpu": 1,
        "memory": 1,
        "storage": 1,
        "pos_x": 1,
        "pos_y": 1,
        "labels": {
          "group": "string",
          "model": "string",
          "sku": "string",
          "rack_name": "string",
          "rack_unit": 1,
          "scalable_unit": 1,
          "rail_index": 1,
          "data_hall": "string",
          "tray_index": 1,
          "role": "string",
          "pod": 1,
          "superspine_group": 1,
          "plane_id": 1
        },
        "metadata": "string",
        "advanced": {
          "nic_model": "virtio",
          "cpu_mode": "custom",
          "cpu_options": [
            "ssse3"
          ],
          "secureboot": false,
          "uefi": false,
          "boot": [
            "hd"
          ]
        },
        "cdrom": {
          "image": "string"
        },
        "storage_pci": {},
        "management_interfaces": {}
      },
      "simulator_config": {},
      "has_os": true
    }
  ],
  "next": "http://api.example.org/accounts/?offset=400&limit=100",
  "previous": "http://api.example.org/accounts/?offset=200&limit=100"
}
```

**SDK Code**

```python
import requests

url = "https://api.dsx-air.nvidia.com/api/v3/simulations/devices/"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.dsx-air.nvidia.com/api/v3/simulations/devices/';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.dsx-air.nvidia.com/api/v3/simulations/devices/"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.dsx-air.nvidia.com/api/v3/simulations/devices/")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.dsx-air.nvidia.com/api/v3/simulations/devices/")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.dsx-air.nvidia.com/api/v3/simulations/devices/', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.dsx-air.nvidia.com/api/v3/simulations/devices/");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.dsx-air.nvidia.com/api/v3/simulations/devices/")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```