> This page is for NVIDIA Infra Controller.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.nvidia.com/infra-controller/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.nvidia.com/infra-controller/_mcp/server.

# Replace all Expected Machines

PUT https://nico-rest-api.nico.svc.cluster.local/v2/org/{org}/nico/expected-machine/all
Content-Type: application/json

Replace the complete Expected Machine set for one Site. Entries omitted from the request are deleted, and entries in the request are created with new REST IDs. The `expectedMachines` array may be empty to clear the Site's set.

Every entry must use the top-level `siteId`. BMC MAC addresses and chassis serial numbers must be unique within the replacement set. Referenced SKUs must exist at the Site.

Org must have an Infrastructure Provider entity and the caller must have Provider Admin access, or the caller must be a Tenant Admin with effective `TargetedInstanceCreation` access to the Site.

Reference: https://docs.nvidia.com/infra-controller/rest-api-reference/api-reference/expected-machine/replace-all-expected-machine

## Authentication

- `Authorization` header (bearer token, required) — ``` export JWT_BEARER_TOKEN="<jwt-bearer-token>" # Example org name: "acme-inc export ORG_NAME=<org-name> # Use the JWT bearer token in your API request auth header: curl -v -X GET -H "Content-Type: application/json" -H "Authorization: Bearer $JWT_BEARER_TOKEN" https://nico-rest-api.nico.svc.cluster.local/v2/org/$ORG_NAME/nico/user/current ```

## Request

### Path parameters

- `org` (string, required) — Name of the Org

### Body (application/json)

This endpoint expects an ExpectedMachineList.

- `siteId` (string, required) — ID of the Site whose Expected Machines should be replaced
- `expectedMachines` (list of ExpectedMachineCreateRequest, required) — Full desired Expected Machine set; BMC MAC addresses and chassis serial numbers must be unique

## Response

### 200

Expected Machines replaced successfully

- `list of ExpectedMachine`

## Errors

### 400 Bad Request Error

Error response when request data cannot be validated

- `source` (string, optional) — Source of the error, taken from `api.name` in the REST API server configuration file (`/app/config.yaml` in the supplied Kubernetes deployment; default API name `nico`). This is a configurable string, for example `nico` or `carbide`
- `message` (string, optional) — Message describing the error
- `data` (NiCoApiErrorData, optional, nullable) — Additional data about the error
- `retryable` (boolean, optional) — True permits bounded retries with backoff, without guaranteeing success. False prohibits automatic retries. Omission means unclassified.

### 403 Forbidden Error

Error response when user is not authorized to call an endpoint or retrieve/modify objects

- `source` (string, optional) — Source of the error, taken from `api.name` in the REST API server configuration file (`/app/config.yaml` in the supplied Kubernetes deployment; default API name `nico`). This is a configurable string, for example `nico` or `carbide`
- `message` (string, optional) — Message describing the error
- `data` (NiCoApiErrorData, optional, nullable) — Additional data about the error
- `retryable` (boolean, optional) — True permits bounded retries with backoff, without guaranteeing success. False prohibits automatic retries. Omission means unclassified.

### 409 Conflict Error

Error response when the request conflicts with an existing resource or operation

- `source` (string, optional) — Source of the error, taken from `api.name` in the REST API server configuration file (`/app/config.yaml` in the supplied Kubernetes deployment; default API name `nico`). This is a configurable string, for example `nico` or `carbide`
- `message` (string, optional) — Message describing the error
- `data` (NiCoApiErrorData, optional, nullable) — Additional data about the error
- `retryable` (boolean, optional) — True permits bounded retries with backoff, without guaranteeing success. False prohibits automatic retries. Omission means unclassified.

## Types

### ExpectedMachineCreateRequest

Request data to create a new ExpectedMachine. Note: BMC credentials (username/password) are only accepted during creation and updates but are not returned in responses.

- `siteId` (string, required) — ID of the site the Expected Machine belongs to
- `bmcMacAddress` (string, required) — MAC address of the Expected Machine's BMC (Baseboard Management Controller)
- `chassisSerialNumber` (string, required) — Serial number of the Expected Machine's chassis
- `defaultBmcUsername` (string, optional, nullable) — Username for accessing the Expected Machine's BMC
- `defaultBmcPassword` (string, optional, nullable) — Password for accessing the Expected Machine's BMC
- `fallbackDPUSerialNumbers` (list of string, optional, nullable) — Serial numbers of the Expected Machine's fallback DPUs (Data Processing Units)
- `interfaces` (list of ExpectedMachineInterface, optional, nullable) — Optional expected host NIC declarations. Omission or null creates an empty list.
- `skuId` (string, optional, nullable) — Optional ID of the SKU to associate with this Expected Machine
- `rackId` (string, optional, nullable) — Optional rack identifier for this component
- `bmcIpAddress` (string, optional, nullable) — Optional BMC IP address (IPv4 or IPv6). When set, pre-allocates a reserved IP for the BMC. It must not be unspecified, multicast, or IPv4 limited broadcast.
- `name` (string, optional, nullable) — Display name for this component
- `manufacturer` (string, optional, nullable) — Manufacturer of this component
- `model` (string, optional, nullable) — Model of this component
- `description` (string, optional, nullable) — Description of this component
- `slotId` (integer, optional, nullable) — Slot ID within the rack
- `trayIdx` (integer, optional, nullable) — Tray index within the rack
- `hostId` (integer, optional, nullable) — Host ID within the tray
- `isDpfEnabled` (boolean, optional, nullable) — When true, this host is eligible for DPF-based provisioning. Optional. Omission or null uses an effective default of true. Set false explicitly to disable DPF-based provisioning.
- `labels` (map from string to string, optional) — User-defined key-value pairs for organizing and categorizing Expected Machines
- `hostLifecycleProfile` (HostLifecycleProfile, optional) — Optional per-host lifecycle profile

### ExpectedMachine

An Expected Machine represents a physical machine that is expected to be discovered at a site, with hardware identifiers and metadata. Note: BMC credentials (username/password) are only accepted during creation and updates but are not returned in responses.

- `id` (string, optional) — Unique identifier for the Expected Machine
- `siteId` (string, optional) — ID of the site the Expected Machine belongs to
- `bmcMacAddress` (string, optional) — MAC address of the Expected Machine's BMC (Baseboard Management Controller)
- `chassisSerialNumber` (string, optional) — Serial number of the Expected Machine's chassis
- `fallbackDPUSerialNumbers` (list of string, optional) — Serial numbers of the Expected Machine's fallback DPUs (Data Processing Units)
- `interfaces` (list of ExpectedMachineInterface, optional) — Expected host NIC declarations in their configured order
- `skuId` (string, optional, nullable) — Optional ID of the SKU associated with this Expected Machine
- `sku` (Sku, optional) — SKU information for this Expected Machine (populated when includeRelation=Sku is specified)
- `machineId` (string, optional, nullable) — Optional ID of the Machine associated with this Expected Machine
- `machine` (MachineSummary, optional) — Machine information for this Expected Machine (populated when includeRelation=Machine is specified)
- `rackId` (string, optional, nullable) — Optional rack identifier for this component
- `bmcIpAddress` (string, optional, nullable) — Optional BMC IP address (IPv4 or IPv6). When set, pre-allocates a reserved IP for the BMC.
- `name` (string, optional, nullable) — Display name for this component
- `manufacturer` (string, optional, nullable) — Manufacturer of this component
- `model` (string, optional, nullable) — Model of this component
- `description` (string, optional, nullable) — Description of this component
- `slotId` (integer, optional, nullable) — Slot ID within the rack
- `trayIdx` (integer, optional, nullable) — Tray index within the rack
- `hostId` (integer, optional, nullable) — Host ID within the tray
- `isDpfEnabled` (boolean, optional) — When true, this host is eligible for DPF-based provisioning. Returns the effective setting: true when no value is configured. An explicitly configured false value is returned as false.
- `labels` (map from string to string, optional) — User-defined key-value pairs for organizing and categorizing Expected Machines
- `hostLifecycleProfile` (HostLifecycleProfile, optional) — Optional per-host lifecycle profile
- `created` (datetime, optional) — ISO 8601 datetime when the Expected Machine was created
- `updated` (datetime, optional) — ISO 8601 datetime when the Expected Machine was last updated

### NiCoApiErrorData

Additional data about the error

### ExpectedMachineInterface

Expected interface declaration. Each supplied list entry replaces the corresponding declaration, so preserve all returned attributes when editing it. Core validates role, primary selection, and allocation against the Site configuration.

- `macAddress` (string, required) — MAC address of the expected interface. Accepts six colon- or hyphen-separated octets in either case; stored and returned in uppercase colon-separated form, for example AA:BB:CC:DD:EE:FF. The same MAC may have separate IPv4 and IPv6 declarations.
- `nicType` (string, optional, nullable) — Optional NIC type. Use `CX9` for ConnectX-9 interfaces on Astra hosts.
- `fixedIp` (string, optional, nullable) — Optional fixed IPv4 or IPv6 address for the interface. It must not be unspecified, multicast, or IPv4 limited broadcast. REST preserves repeated MAC declarations without enforcing uniqueness by MAC and address family; Core applies allocation validation.
- `fixedMask` (string, optional, nullable) — Optional legacy mask string, forwarded unchanged. Omission or null clears it when replacing the declaration.
- `fixedGateway` (string, optional, nullable) — Optional IPv4 or IPv6 gateway. Omission, null, or an empty string clears it when replacing the declaration.
- `primary` (boolean, optional, nullable) — Host boot-interface selection. At most one Host interface per machine may set true. Omission or null clears the declaration. DpuOs and DpuBmc must omit it; HostBmc also accepts false.
- `networkSegmentType` (enum, optional) — Optional segment constraint that takes precedence over nicType. Omission or null clears it. For explicit allocation policies and DPU roles it constrains relay-selected or fixed-address segments; legacy Host declarations without an explicit policy use it only for initial DHCP segment selection.
  - Allowed values: `Tenant`, `Admin`, `Underlay`, `HostInband`
- `role` (enum, optional) — Interface owner. On create, omission, null, or Unspecified means Host. On update, omission or null preserves a matching stored role; Unspecified resets it to Host. At most one HostBmc is allowed, with the same MAC as bmcMacAddress.
  - Allowed values: `Unspecified`, `Host`, `DpuOs`, `DpuBmc`, `HostBmc`
- `ipAllocation` (enum, optional) — On create, omission, null, or Unspecified infers Fixed from fixedIp, otherwise Retained for HostBmc and Dynamic for other roles. On update, omission or null preserves a matching stored policy while fixedIp presence is unchanged; Unspecified resets inference. Fixed requires fixedIp; Dynamic and Retained forbid it. Explicit Fixed, inferred DPU Fixed, and inferred HostBmc Fixed with a segment constraint require a containing managed prefix; legacy Host or inferred HostBmc Fixed without a constraint may use static assignments. Retained keeps a DHCP-allocated address for the interface row lifetime.
  - Allowed values: `Unspecified`, `Dynamic`, `Fixed`, `Retained`

### HostLifecycleProfile

Per-host lifecycle settings that affect how NICo progresses a host through its state machine.

- `disableLockdown` (boolean, optional, nullable) — When true, the server is not locked down during host lifecycle management. When omitted, the existing value is preserved.

### Sku

A SKU (Stock Keeping Unit) represents a unique hardware configuration discovered at a site. SKUs are automatically derived from machine hardware characteristics and used to group similar machines.

- `id` (string, optional) — Unique identifier for the SKU
- `siteId` (string, optional) — ID of the Site this SKU belongs to
- `description` (string, optional) — Human-readable SKU description
- `schemaVersion` (uint, optional) — Core SKU schema version when available
- `deviceType` (string, optional, nullable) — Optional device type identifier (e.g. "gpu", "cpu", "storage")
- `associatedMachineIds` (list of string, optional) — List of machine IDs associated with this SKU
- `components` (SkuComponents, optional) — Hardware components of this SKU
- `created` (datetime, optional) — ISO 8601 datetime when the SKU was created, using the Site-reported timestamp when available

### MachineSummary

Describes a subset of core attributes for a Machine

- `id` (string, optional) — Unique ID of Machine
- `controllerMachineId` (string, optional) — ID of the Machine at Site, now same as the primary ID
- `controllerMachineType` (string, optional, nullable) — Denotes architecture (x86 vs ARM) of the Machine
- `hwSkuDeviceType` (string, optional, nullable) — SKU derived device type of the machine, e.g. cpu, gpu, cache, storage, etc.
- `vendor` (string, optional, nullable) — Name of the vendor of the Machine
- `productName` (string, optional, nullable) — Product name of the Machine
- `maintenanceMessage` (string, optional, nullable) — If the Machine is in maintenance mode, this message will typically describe the reason and how long it is expected to be in maintenance
- `status` (enum, optional) — Status represents the status of the machine
  - Allowed values: `Initializing`, `Ready`, `Reset`, `Maintenance`, `InUse`, `Error`, `Decommissioning`, `Decommissioned`, `Unknown`

### SkuComponents

Hardware components that make up a SKU

- `cpus` (list of SkuCpu, optional) — CPU components
- `gpus` (list of SkuGpu, optional) — GPU components
- `memory` (list of SkuMemory, optional) — Memory components
- `storage` (list of SkuStorage, optional) — Storage components
- `chassis` (SkuChassis, optional) — Chassis component
- `ethernetDevices` (list of SkuEthernetDevice, optional) — Read-only Ethernet device components reported by Core. Omit this property from REST mutation requests; null and an empty array are accepted for compatibility, while a non-empty array is rejected with HTTP 400.
- `infinibandDevices` (list of SkuInfinibandDevice, optional) — Infiniband device components
- `tpm` (list of SkuTpm, optional) — TPM components

### SkuCpu

CPU component in a SKU

- `vendor` (string, optional) — Vendor of the CPU
- `model` (string, optional) — Model of the CPU
- `threadCount` (uint, optional) — Number of threads for the CPU
- `count` (uint, optional) — Number of CPUs present

### SkuGpu

GPU component in a SKU

- `vendor` (string, optional) — Vendor of the GPU
- `model` (string, optional) — Model of the GPU
- `totalMemory` (string, optional) — Total memory of the GPU (e.g. "80GB HBM3")
- `count` (uint, optional) — Number of GPUs present

### SkuMemory

Memory component in a SKU

- `capacityMb` (uint, optional) — Capacity in megabytes
- `memoryType` (string, optional) — Type of memory (e.g. "DDR4", "DDR5")
- `count` (uint, optional) — Number of memory modules present

### SkuStorage

Storage component in a SKU

- `vendor` (string, optional) — Storage vendor used for schema version 4 matching. Read-only in REST mutation requests and preserved in responses for legacy SKUs. Schema version 5 does not use this field.
- `model` (string, optional) — Informational storage model. Starting with the 2.1 release, NICo does not use this field for storage matching or validation.
- `capacityMb` (uint, optional) — Storage capacity in megabytes used for schema version 4 matching. Read-only in REST mutation requests and preserved in responses for legacy SKUs. Schema version 5 uses minSizeMiB and maxSizeMiB instead.
- `count` (uint, optional) — Number of storage devices present
- `minSizeMiB` (uint, optional, nullable) — Inclusive minimum size in MiB for each storage device. Null or omission means no lower bound. Used for SKU schema version 5 and later.
- `maxSizeMiB` (uint, optional, nullable) — Inclusive maximum size in MiB for each storage device. Null or omission means no upper bound. Used for SKU schema version 5 and later.
- `pciPatterns` (list of string, optional) — Regular expressions matched against each drive's sysfs PCI path. An empty or omitted list disables PCI location matching. Used for SKU schema version 5 and later. The matched path is the NVMe controller's sysfs DEVPATH with its trailing kernel-assigned `nvmeN` node removed, for example `/devices/pci0000:00/0000:64:00.0/0000:65:00.0/nvme`, because that node changes with probe order. Patterns that anchor on the node (such as `nvme0$`) never match; end them at `/nvme` instead.

### SkuChassis

Chassis component in a SKU

- `vendor` (string, optional) — Vendor of the chassis
- `model` (string, optional) — Model of the chassis
- `architecture` (string, optional) — Architecture of the chassis

### SkuEthernetDevice

Ethernet device component in a SKU

- `vendor` (string, optional) — Vendor of the ethernet device
- `model` (string, optional) — Model of the ethernet device
- `count` (uint, optional) — Number of ethernet devices present
- `isConnected` (boolean, optional) — Whether the ethernet device is connected

### SkuInfinibandDevice

Infiniband device component in a SKU

- `vendor` (string, optional) — Vendor of the infiniband device
- `model` (string, optional) — Model of the infiniband device
- `count` (uint, optional) — Number of infiniband devices present
- `inactiveDevices` (list of uint, optional) — Zero-based indexes of inactive devices

### SkuTpm

TPM component in a SKU

- `vendor` (string, optional) — Vendor of the TPM
- `version` (string, optional) — Version of the TPM

## Examples

**Request**

```json
{
  "siteId": "f97df110-f4de-492e-8849-4a6af68026b0",
  "expectedMachines": [
    {
      "siteId": "f97df110-f4de-492e-8849-4a6af68026b0",
      "bmcMacAddress": "00:1A:2B:3C:4D:5E",
      "chassisSerialNumber": "CHASSIS-12345",
      "defaultBmcUsername": "admin",
      "defaultBmcPassword": "password123",
      "labels": {
        "rack": "A1"
      }
    }
  ]
}
```

**Response**

```json
[
  {
    "id": "string",
    "siteId": "string",
    "bmcMacAddress": "string",
    "chassisSerialNumber": "string",
    "fallbackDPUSerialNumbers": [
      "string"
    ],
    "interfaces": [
      {
        "macAddress": "string",
        "nicType": "string",
        "fixedIp": "string",
        "fixedMask": "string",
        "fixedGateway": "string",
        "primary": true,
        "networkSegmentType": "Tenant",
        "role": "Unspecified",
        "ipAllocation": "Unspecified"
      }
    ],
    "skuId": "string",
    "sku": {
      "id": "lenovo.sr650v2.cpu.1",
      "siteId": "60189e9c-7d12-438c-b9ca-6998d9c364b1",
      "description": "Lenovo SR650 V2 compute node",
      "schemaVersion": 5,
      "deviceType": "gpu",
      "associatedMachineIds": [
        "fm100ht4v4mce2qstjnl8970nnj3ie6ecek4mtjn27pea4kre5gsa49jg0g"
      ],
      "components": {
        "cpus": [
          {
            "vendor": "Intel",
            "model": "Xeon Platinum 8480+",
            "threadCount": 112,
            "count": 2
          }
        ],
        "gpus": [
          {
            "vendor": "NVIDIA",
            "model": "H100 SXM5",
            "totalMemory": "80GB HBM3",
            "count": 8
          }
        ],
        "memory": [
          {
            "capacityMb": 65536,
            "memoryType": "DDR5",
            "count": 16
          }
        ],
        "storage": [
          {
            "vendor": "Samsung",
            "model": "PM9A3",
            "capacityMb": 7680000,
            "count": 4
          }
        ],
        "chassis": {
          "vendor": "Supermicro",
          "model": "SYS-420GP-TNR"
        }
      },
      "created": "2019-08-24T14:15:22Z"
    },
    "machineId": "string",
    "machine": {
      "id": "fm100ht4v4mce2qstjnl8970nnj3ie6ecek4mtjn27pea4kre5gsa49jg0g",
      "controllerMachineId": "fm100ht4v4mce2qstjnl8970nnj3ie6ecek4mtjn27pea4kre5gsa49jg0g",
      "controllerMachineType": "x86_64",
      "hwSkuDeviceType": "cpu",
      "vendor": "Lenovo",
      "productName": "ThinkSystem SR670 V2",
      "maintenanceMessage": null,
      "status": "Ready"
    },
    "rackId": "string",
    "bmcIpAddress": "string",
    "name": "string",
    "manufacturer": "string",
    "model": "string",
    "description": "string",
    "slotId": 1,
    "trayIdx": 1,
    "hostId": 1,
    "isDpfEnabled": true,
    "labels": {},
    "hostLifecycleProfile": {
      "disableLockdown": true
    },
    "created": "2024-01-15T09:30:00Z",
    "updated": "2024-01-15T09:30:00Z"
  }
]
```

**SDK Code**

```python
import requests

url = "https://nico-rest-api.nico.svc.cluster.local/v2/org/org/nico/expected-machine/all"

payload = {
    "siteId": "f97df110-f4de-492e-8849-4a6af68026b0",
    "expectedMachines": [
        {
            "siteId": "f97df110-f4de-492e-8849-4a6af68026b0",
            "bmcMacAddress": "00:1A:2B:3C:4D:5E",
            "chassisSerialNumber": "CHASSIS-12345",
            "defaultBmcUsername": "admin",
            "defaultBmcPassword": "password123",
            "labels": { "rack": "A1" }
        }
    ]
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.put(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://nico-rest-api.nico.svc.cluster.local/v2/org/org/nico/expected-machine/all';
const options = {
  method: 'PUT',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"siteId":"f97df110-f4de-492e-8849-4a6af68026b0","expectedMachines":[{"siteId":"f97df110-f4de-492e-8849-4a6af68026b0","bmcMacAddress":"00:1A:2B:3C:4D:5E","chassisSerialNumber":"CHASSIS-12345","defaultBmcUsername":"admin","defaultBmcPassword":"password123","labels":{"rack":"A1"}}]}'
};

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"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://nico-rest-api.nico.svc.cluster.local/v2/org/org/nico/expected-machine/all"

	payload := strings.NewReader("{\n  \"siteId\": \"f97df110-f4de-492e-8849-4a6af68026b0\",\n  \"expectedMachines\": [\n    {\n      \"siteId\": \"f97df110-f4de-492e-8849-4a6af68026b0\",\n      \"bmcMacAddress\": \"00:1A:2B:3C:4D:5E\",\n      \"chassisSerialNumber\": \"CHASSIS-12345\",\n      \"defaultBmcUsername\": \"admin\",\n      \"defaultBmcPassword\": \"password123\",\n      \"labels\": {\n        \"rack\": \"A1\"\n      }\n    }\n  ]\n}")

	req, _ := http.NewRequest("PUT", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	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://nico-rest-api.nico.svc.cluster.local/v2/org/org/nico/expected-machine/all")

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

request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"siteId\": \"f97df110-f4de-492e-8849-4a6af68026b0\",\n  \"expectedMachines\": [\n    {\n      \"siteId\": \"f97df110-f4de-492e-8849-4a6af68026b0\",\n      \"bmcMacAddress\": \"00:1A:2B:3C:4D:5E\",\n      \"chassisSerialNumber\": \"CHASSIS-12345\",\n      \"defaultBmcUsername\": \"admin\",\n      \"defaultBmcPassword\": \"password123\",\n      \"labels\": {\n        \"rack\": \"A1\"\n      }\n    }\n  ]\n}"

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.put("https://nico-rest-api.nico.svc.cluster.local/v2/org/org/nico/expected-machine/all")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"siteId\": \"f97df110-f4de-492e-8849-4a6af68026b0\",\n  \"expectedMachines\": [\n    {\n      \"siteId\": \"f97df110-f4de-492e-8849-4a6af68026b0\",\n      \"bmcMacAddress\": \"00:1A:2B:3C:4D:5E\",\n      \"chassisSerialNumber\": \"CHASSIS-12345\",\n      \"defaultBmcUsername\": \"admin\",\n      \"defaultBmcPassword\": \"password123\",\n      \"labels\": {\n        \"rack\": \"A1\"\n      }\n    }\n  ]\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('PUT', 'https://nico-rest-api.nico.svc.cluster.local/v2/org/org/nico/expected-machine/all', [
  'body' => '{
  "siteId": "f97df110-f4de-492e-8849-4a6af68026b0",
  "expectedMachines": [
    {
      "siteId": "f97df110-f4de-492e-8849-4a6af68026b0",
      "bmcMacAddress": "00:1A:2B:3C:4D:5E",
      "chassisSerialNumber": "CHASSIS-12345",
      "defaultBmcUsername": "admin",
      "defaultBmcPassword": "password123",
      "labels": {
        "rack": "A1"
      }
    }
  ]
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://nico-rest-api.nico.svc.cluster.local/v2/org/org/nico/expected-machine/all");
var request = new RestRequest(Method.PUT);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"siteId\": \"f97df110-f4de-492e-8849-4a6af68026b0\",\n  \"expectedMachines\": [\n    {\n      \"siteId\": \"f97df110-f4de-492e-8849-4a6af68026b0\",\n      \"bmcMacAddress\": \"00:1A:2B:3C:4D:5E\",\n      \"chassisSerialNumber\": \"CHASSIS-12345\",\n      \"defaultBmcUsername\": \"admin\",\n      \"defaultBmcPassword\": \"password123\",\n      \"labels\": {\n        \"rack\": \"A1\"\n      }\n    }\n  ]\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "siteId": "f97df110-f4de-492e-8849-4a6af68026b0",
  "expectedMachines": [
    [
      "siteId": "f97df110-f4de-492e-8849-4a6af68026b0",
      "bmcMacAddress": "00:1A:2B:3C:4D:5E",
      "chassisSerialNumber": "CHASSIS-12345",
      "defaultBmcUsername": "admin",
      "defaultBmcPassword": "password123",
      "labels": ["rack": "A1"]
    ]
  ]
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://nico-rest-api.nico.svc.cluster.local/v2/org/org/nico/expected-machine/all")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

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()
```