Skip to navigation

Update Expected Switch

View as Markdown

Update an existing Expected Switch by ID.

Org must have an Infrastructure Provider entity. User must have authorization role with PROVIDER_ADMIN suffix.

Infrastructure Provider must own the Expected Switch.

Alternatively, Tenant Admins with TargetedInstanceCreation capability can also update Expected Switches if they have an account with the Site’s Infrastructure Provider.

Authentication

AuthorizationBearer
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

Path parameters

orgstringRequired
Name of the Org
expectedSwitchIdstringRequired
ID of the Expected Switch

Request

Expected Switch update request.

Provide the username, the password, or both to update BMC or NVOS credentials. Each supplied value must be non-empty. Omitted credential fields and JSON null preserve the stored values. BMC and NVOS credentials can be changed independently in the same request. When setting NVOS credentials for the first time, provide both nvOsUsername and nvOsPassword; a missing stored partner is rejected with HTTP 400. Credential removal is not supported.

idstring or nullOptionalformat: "uuid"

ID of the Expected Switch to update.

For single updates, omit id or set it to null to use the ID from the URL path. A non-null body id must match the URL ID and use lowercase, hyphenated UUID format. Otherwise, REST returns HTTP 400.

defaultBmcUsernamestring or nullOptional>=1 character

Username for accessing the Expected Switch’s BMC (no API length limit; the BMC’s username policy still applies). Omission or null preserves the value. A non-empty value can be supplied without defaultBmcPassword.

defaultBmcPasswordstring or nullOptional1-255 characters

Password for accessing the Expected Switch’s BMC (up to 255 characters; the BMC’s password policy still applies). Omission or null preserves the value. A non-empty value can be supplied without defaultBmcUsername.

switchSerialNumberstring or nullOptional1-32 characters
Serial number of the Expected Switch
nvOsUsernamestring or nullOptional>=1 character

NvOS username for the Expected Switch. Omission or null preserves the value. A non-empty value can be supplied without nvOsPassword. Provide both fields when setting NVOS credentials for the first time.

nvOsPasswordstring or nullOptional>=1 character

NvOS password for the Expected Switch. Omission or null preserves the value. A non-empty value can be supplied without nvOsUsername. Provide both fields when setting NVOS credentials for the first time.

nvosInterfaceslist of objectsOptional

Replace the Expected Switch’s NVOS ethernet port set. Omission preserves the stored ports; an empty array is rejected because a switch must keep at least one NVOS port. Mark one entry primary to choose eth0. The deprecated nvosMacAddresses field is ignored even when both fields are supplied.

rackIdstring or nullOptional
Optional rack identifier for this component
bmcIpAddressstring or nullOptional

Optional BMC IP address (IPv4 or IPv6). A non-empty address sets the value and pre-allocates a reserved IP for the BMC. An empty string clears the value. Omission or null preserves the current value. It must not be unspecified, multicast, or IPv4 limited broadcast.

namestring or nullOptional
Display name for this component
manufacturerstring or nullOptional
Manufacturer of this component
modelstring or nullOptional
Model of this component
descriptionstring or nullOptional
Description of this component
slotIdinteger or nullOptional
Slot ID within the rack
trayIdxinteger or nullOptional
Tray index within the rack
hostIdinteger or nullOptional
Host ID within the tray
labelsmap from strings to stringsOptional

User-defined key-value pairs for organizing and categorizing Expected Switches

bmcMacAddressstring or nullOptionalformat: "^([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2})$"Deprecated

Immutable MAC address of the Expected Switch’s BMC (Baseboard Management Controller). Omit this field when updating. A formatting-equivalent value is accepted for compatibility and preserves the originally stored spelling, but changing the physical MAC address is rejected with HTTP 400.

nvosMacAddresseslist of stringsOptionalDeprecated

Deprecated and ignored. Omitted, null, empty, and nonempty values all leave stored ports and primary selection unchanged. Use nvosInterfaces to replace ports. Supplying both fields is allowed; only nvosInterfaces takes effect.

Response

OK
idstringOptionalRead-onlyformat: "uuid"
Unique identifier for the Expected Switch
siteIdstringOptionalRead-onlyformat: "uuid"
ID of the site the Expected Switch belongs to
bmcMacAddressstringOptionalformat: "^([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2})$"

MAC address of the Expected Switch’s BMC (Baseboard Management Controller)

switchSerialNumberstringOptional
Serial number of the Expected Switch
nvosInterfaceslist of objectsOptional

NVOS ethernet ports of the Expected Switch, with the primary (eth0) port flagged. Array order is not stable across inventory synchronization; identify ports by MAC and use isPrimary for selection.

rackIdstring or nullOptional
Optional rack identifier for this component
bmcIpAddressstring or nullOptional

Optional BMC IP address (IPv4 or IPv6). When set, pre-allocates a reserved IP for the BMC.

namestring or nullOptional
Display name for this component
manufacturerstring or nullOptional
Manufacturer of this component
modelstring or nullOptional
Model of this component
descriptionstring or nullOptional
Description of this component
slotIdinteger or nullOptional
Slot ID within the rack
trayIdxinteger or nullOptional
Tray index within the rack
hostIdinteger or nullOptional
Host ID within the tray
labelsmap from strings to stringsOptional

User-defined key-value pairs for organizing and categorizing Expected Switches

createddatetimeOptionalRead-only
ISO 8601 datetime when the Expected Switch was created
updateddatetimeOptionalRead-only
ISO 8601 datetime when the Expected Switch was last updated
nvosMacAddresseslist of stringsOptionalDeprecated

Deprecated flat NVOS MAC list retained for v2 compatibility. Use nvosInterfaces. Responses emit both fields, and this array contains the same MACs in the same order as nvosInterfaces.

Errors

400
Bad Request Error
403
Forbidden Error
404
Not Found Error
409
Conflict Error