> For the complete documentation index, see [llms.txt](https://doc.engenius.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://doc.engenius.ai/smartnic-redfish-user-guide/reference/command-syntax-reference.md).

# Command Syntax Reference

This chapter provides **copy-ready** `curl` patterns for common Redfish operations on the EnGenius SmartNIC. It focuses on **what to send**, **where to send it**, and **what to expect**.\
Use **placeholders** (for example, `{BMC_IP}`, `{ManagerId}`, `{SystemId}`, `{TaskId}`) and **session tokens**. Lab-only flags are clearly marked; **do not** use them in production.

### How to use these commands

1. **Set variables** (once per session): replace placeholders with your values.
2. **Create a session**: capture `X-Auth-Token`; include it on all requests.
3. **Discover IDs**: read the **Service root** and collections to find `{ManagerId}`, `{SystemId}`, `{ChassisId}`.
4. **Run the task**: pick a section below (accounts, updates, inventory…).
5. **Interpret responses**: check `@Message.ExtendedInfo`; use the snippet in **Troubleshooting** to extract `MessageId`.
6. **Security**: use trusted certificates; `-k` is **lab-only**.

#### Conventions

```bash
BMC_IP="192.168.137.210" # replace with your BMC address/hostname
USERNAME="root" # replace for production
PASSWORD="0penBmc" # replace for production
```

```bash
TOKEN=$(curl -s -X POST "https://${BMC_IP}/redfish/v1/SessionService/Sessions" \
  -H "Content-Type: application/json" \
  -d "{\"UserName\":\"${USERNAME}\",\"Password\":\"${PASSWORD}\"}" \
  -D - | awk '/X-Auth-Token:/ {print $2}' | tr -d '\r')

HDR_AUTH=(-H "X-Auth-Token: ${TOKEN}")
HDR_JSON=(-H "Content-Type: application/json")
```

> If your lab lacks a trusted CA, you may temporarily add `-k` to the `curl` commands above. In production, enroll a trusted certificate via CertificateService and remove `-k`.

#### Service discovery (read-only)

```bash
curl -s -X GET "https://${BMC_IP}/redfish/v1" "${HDR_AUTH[@]}"
```

```json
{
"@odata.id": "/redfish/v1",
"Managers": {"@odata.id": "/redfish/v1/Managers"},
"Systems": {"@odata.id": "/redfish/v1/Systems"},
"AccountService": {"@odata.id": "/redfish/v1/AccountService"},
"UpdateService": {"@odata.id": "/redfish/v1/UpdateService"},
"TaskService": {"@odata.id": "/redfish/v1/TaskService"},
"Registries": {"@odata.id": "/redfish/v1/Registries"}
}
```

**Discover actual IDs:**

```bash
curl -s "https://${BMC_IP}/redfish/v1/Managers" "${HDR_AUTH[@]}"
| jq -r '.Members[]."@odata.id"'
Example output: /redfish/v1/Managers/BMC0 → use BMC0 as {ManagerId}
curl -s "https://${BMC_IP}/redfish/v1/Systems" "${HDR_AUTH[@]}"
| jq -r '.Members[]."@odata.id"'
Example output: /redfish/v1/Systems/system0 → use system0 as {SystemId}
```

### Accounts & Roles

{% code overflow="wrap" %}

```bash
curl -s -X GET "https://${BMC_IP}/redfish/v1/AccountService/Accounts" "${HDR_AUTH[@]}"
```

{% endcode %}

{% code overflow="wrap" %}

```bash
curl -s -X POST "https://${BMC_IP}/redfish/v1/AccountService/Accounts"
"${HDR_AUTH[@]}" "${HDR_JSON[@]}"
-d '{"Enabled":true,"UserName":"ian","Password":"P@ssw0rd123!","RoleId":"Administrator"}'
```

{% endcode %}

{% code overflow="wrap" %}

```bash
ACCOUNT_ID="ian" # or the Id returned by the collection curl -s -X DELETE "https://${BMC_IP}/redfish/v1/AccountService/Accounts/${ACCOUNT_ID}" "${HDR_AUTH[@]}"\
```

{% endcode %}

{% hint style="info" %}
**Note**: Inspect `@Message.ExtendedInfo[].MessageId` and `Resolution` for success/fix hints. See **User roles and privileges** for role details.
{% endhint %}

### Certificates & trust (*if implemented*)

{% code overflow="wrap" %}

```bash
curl -s -X GET "https://${BMC_IP}/redfish/v1/CertificateService" "${HDR_AUTH[@]}" curl -s -X GET "https://${BMC_IP}/redfish/v1/CertificateService/CertificateLocations" "${HDR_AUTH[@]}"
```

{% endcode %}

{% code overflow="wrap" %}

```bash
MANAGER_ID="BMC0" # discover actual Id from /Managers curl -s -X GET "https://${BMC_IP}/redfish/v1/Managers/${MANAGER_ID}/NetworkProtocol/HTTPS/Certificates" "${HDR_AUTH[@]}"
```

{% endcode %}

{% hint style="info" %}
**Note:** CSR generation and certificate replacement are exposed as **CertificateService Actions** *if supported by your firmware*.
{% endhint %}

### Firmware updates&#x20;

**HTTP push (workstation → BMC)**

```bash
curl -s -X PATCH "https://${BMC_IP}/redfish/v1/UpdateService"
"${HDR_AUTH[@]}" "${HDR_JSON[@]}"
-d '{"HttpPushUriOptions":{"HttpPushUriApplyTime":{"ApplyTime":"Immediate"}}}'
```

```bash
HTTP_PUSH_URI=$(curl -s "https://${BMC_IP}/redfish/v1/UpdateService" "${HDR_AUTH[@]}"
| jq -r '.HttpPushUri // empty') echo "${HTTP_PUSH_URI}"
```

```bash
IMAGE_FILE="/path/IMAGE.bin" curl -s -X POST "${HTTP_PUSH_URI}" "${HDR_AUTH[@]}"
-H "Content-Type: application/octet-stream"
--data-binary @"${IMAGE_FILE}" -i
```

**SimpleUpdate (BMC → TFTP server)&#x20;*****if enabled***

{% code overflow="wrap" %}

```bash
TFTP_SERVER="10.0.0.20" IMAGE_PATH="fw/IMAGE.bin" curl -s -X POST "https://${BMC_IP}/redfish/v1/UpdateService/Actions/UpdateService.SimpleUpdate"
"${HDR_AUTH[@]}" "${HDR_JSON[@]}"
-d "{"ImageURI":"tftp://${TFTP_SERVER}/${IMAGE_PATH}","TransferProtocol":"TFTP"}" -i
```

{% endcode %}

{% hint style="danger" %}
**Security:** TFTP is unauthenticated. Restrict to an isolated management network or prefer HTTP push with trusted certificates.
{% endhint %}

### Task tracking

{% code overflow="wrap" %}

```bash
TaskId="Task-1" # from Location header or task object curl -s "https://${BMC_IP}/redfish/v1/TaskService/Tasks/${TaskId}" "${HDR_AUTH[@]}"
```

{% endcode %}

### Firmware/software inventory

{% code overflow="wrap" %}

```bash
curl -s "https://${BMC_IP}/redfish/v1/UpdateService/FirmwareInventory" "${HDR_AUTH[@]}"
```

{% endcode %}

{% code overflow="wrap" %}

```bash
ItemId="BMC_Active" # discover from the collection; names vary by firmware curl -s "https://${BMC_IP}/redfish/v1/UpdateService/FirmwareInventory/${ItemId}" "${HDR_AUTH[@]}"
```

{% endcode %}

### Logging (*OEM, if implemented*)

{% code overflow="wrap" %}

```bash
ManagerId="BMC0" curl -s "https://${BMC_IP}/redfish/v1/Managers/${ManagerId}/SyslogService" "${HDR_AUTH[@]}"
```

{% endcode %}

{% code overflow="wrap" %}

```bash
curl -s -X PATCH "https://${BMC_IP}/redfish/v1/Managers/${ManagerId}/SyslogService"
"${HDR_AUTH[@]}" "${HDR_JSON[@]}"
-d '{"SyslogServers":[{"Address":"10.0.0.10","Protocol":"TCP","Port":"514","Enabled":true,"FilterSeverity":"Error","FilterFacilities":["User","Local1"]}]}'
```

{% endcode %}

### Troubleshooting snippets

{% code overflow="wrap" %}

```bash
REQ_PATH="/redfish/v1/.../YourRequest" curl -s "https://${BMC_IP}${REQ_PATH}" "${HDR_AUTH[@]}"
| jq -r '."@Message.ExtendedInfo"[].MessageId'
```

{% endcode %}

Look up the `MessageId` in `/redfish/v1/Registries` to read the description and Resolution. For repeated `5xx`, retry briefly; if persistent and the message advises, reset the affected service/BMC during a maintenance window.

{% hint style="warning" %}
**Security notes**&#x20;

* Replace lab credentials immediately; enforce least-privilege roles and disable unused accounts.
* Enroll a trusted TLS certificate via CertificateService; do not use `-k` in production.
* Features marked *if implemented*/OEM depend on firmware/platform—discover first from the Service root and collections.
  {% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://doc.engenius.ai/smartnic-redfish-user-guide/reference/command-syntax-reference.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
