CLI
11 operations. Call any of them with omada_call_operation (or, in full tool mode, as a tool named by its operationId).
| Operation | Method | Summary |
|---|---|---|
| getCliConfig | GET | Get the CLI configuration content |
| modifyCliConfig | PATCH | Modify the CLI configuration content |
| createCliConfig | POST | Create a new CLI configuration |
| getCliDevice | GET | Get device list when importing device configuration |
| getCliDeviceByType | GET | Get device list when creating CLI |
| deleteCliConfig | DELETE | Delete the CLI configuration |
| getCliList | GET | Get the CLI configuration list |
| applyCliConfig | POST | Apply the CLI configuration |
| exportCliVariableToFile | POST | Export CLI variable |
| importCliVariableToFile | POST | Import CLI variable |
| getModelAndVersionListByType | GET | Get model and version for model CLI. |
getCliConfig
GET /openapi/v1/{omadacId}/sites/{siteId}/cli/config/cli-type/{cliType}/config-id/{configId}
Get the CLI configuration content
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
omadacId | path | string | auto | Omada ID (filled in automatically) |
siteId | path | string | yes | Site ID (site ID or site name) |
cliType | path | string | yes | CLI type should be a value as follows: 0: site CLI; 1: device CLI; 2:model CLI. Site template only supports site CLI. Site template only supports site CLI. |
configId | path | string | yes | CLI Config ID |
// omada_call_operation
{
"operationId": "getCliConfig",
"params": {
"siteId": "<siteId>",
"cliType": "<cliType>",
"configId": "<configId>"
}
}Details, permissions and error codes
Get the CLI configuration content
The interface requires one of the permissions:
Site Settings Manager View Only
Network Config Page View Only
The possible error code for the interface in the returned body is one of the following error codes (non generic error codes):
-1001 - Invalid request parameters.
-33004 - Operation failed because other operations (site copying, restoring, template synchronizing, etc.) are being performed on this site. Please wait and try again later.
modifyCliConfig
PATCH /openapi/v1/{omadacId}/sites/{siteId}/cli/config/cli-type/{cliType}/config-id/{configId}
Modify the CLI configuration content
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
omadacId | path | string | auto | Omada ID (filled in automatically) |
siteId | path | string | yes | Site ID (site ID or site name) |
cliType | path | string | yes | CLI type should be a value as follows: 0: site CLI; 1: device CLI; 2:model CLI. Site template only supports site CLI. Site template only supports site CLI. |
configId | path | string | yes | CLI Config ID |
Request body — application/json (required) — schema ModifyCliOpenApiVO
| Field | Type | Required | Description |
|---|---|---|---|
name | string | yes | CLI configuration name, it should be within the range of 1 - 64 characters |
deviceType | string | yes | Device type for CLI configuration application, it should be a value as follows: switch. |
description | string | no | CLI configuration description, it should be within the range of 0 - 256 characters. |
cliConfig | string | yes | CLI configuration content |
devices | array<DeviceCliVO> | no | List of devices bound to the CLI configuration. |
stacks | array<StackCliVO> | no | List of stacks bound to the CLI configuration, only device CLI has this field. |
model | string | no | Device model of model cli |
modelVersion | string | no | Device model version of model cli |
// omada_call_operation
{
"operationId": "modifyCliConfig",
"params": {
"siteId": "<siteId>",
"cliType": "<cliType>",
"configId": "<configId>"
},
"body": "{...}"
}Details, permissions and error codes
Modify the CLI configuration content
The interface requires one of the permissions:
Site Settings Manager Modify
Network Config Page Modify
The possible error code for the interface in the returned body is one of the following error codes (non generic error codes):
-1001 - Invalid request parameters.
-33004 - Operation failed because other operations (site copying, restoring, template synchronizing, etc.) are being performed on this site. Please wait and try again later.
createCliConfig
POST /openapi/v1/{omadacId}/sites/{siteId}/cli/config/cli-type/{cliType}/save
Create a new CLI configuration
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
omadacId | path | string | auto | Omada ID (filled in automatically) |
siteId | path | string | yes | Site ID (site ID or site name) |
cliType | path | string | yes | CLI type should be a value as follows: 0: site CLI; 1: device CLI; 2:model CLI. Site template only supports site CLI. Site template only supports site CLI. |
Request body — application/json (required) — schema ModifyCliOpenApiVO
| Field | Type | Required | Description |
|---|---|---|---|
name | string | yes | CLI configuration name, it should be within the range of 1 - 64 characters |
deviceType | string | yes | Device type for CLI configuration application, it should be a value as follows: switch. |
description | string | no | CLI configuration description, it should be within the range of 0 - 256 characters. |
cliConfig | string | yes | CLI configuration content |
devices | array<DeviceCliVO> | no | List of devices bound to the CLI configuration. |
stacks | array<StackCliVO> | no | List of stacks bound to the CLI configuration, only device CLI has this field. |
model | string | no | Device model of model cli |
modelVersion | string | no | Device model version of model cli |
// omada_call_operation
{
"operationId": "createCliConfig",
"params": {
"siteId": "<siteId>",
"cliType": "<cliType>"
},
"body": "{...}"
}Details, permissions and error codes
Create a new CLI configuration
The interface requires one of the permissions:
Site Settings Manager Modify
Network Config Page Modify
The possible error code for the interface in the returned body is one of the following error codes (non generic error codes):
-1001 - Invalid request parameters.
-33004 - Operation failed because other operations (site copying, restoring, template synchronizing, etc.) are being performed on this site. Please wait and try again later.
getCliDevice
GET /openapi/v1/{omadacId}/sites/{siteId}/cli/config/devices
Get device list when importing device configuration
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
omadacId | path | string | auto | Omada ID (filled in automatically) |
siteId | path | string | yes | Site ID (site ID or site name) |
// omada_call_operation
{
"operationId": "getCliDevice",
"params": {
"siteId": "<siteId>"
}
}Details, permissions and error codes
Get device list when importing device configuration
The interface requires one of the permissions:
Site Settings Manager View Only
Network Config Page View Only
getCliDeviceByType
GET /openapi/v1/{omadacId}/sites/{siteId}/cli/config/devices/device-type/{deviceType}
Get device list when creating CLI
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
omadacId | path | string | auto | Omada ID (filled in automatically) |
siteId | path | string | yes | Site ID (site ID or site name) |
deviceType | path | string | yes | Device Type. Supported type: switch. |
// omada_call_operation
{
"operationId": "getCliDeviceByType",
"params": {
"siteId": "<siteId>",
"deviceType": "<deviceType>"
}
}Details, permissions and error codes
Get device list when creating CLI
The interface requires one of the permissions:
Site Settings Manager View Only
Network Config Page View Only
The possible error code for the interface in the returned body is one of the following error codes (non generic error codes):
-1001 - Invalid request parameters.
deleteCliConfig
DELETE /openapi/v1/{omadacId}/sites/{siteId}/cli/configs/cli-type/{cliType}
Delete the CLI configuration
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
omadacId | path | string | auto | Omada ID (filled in automatically) |
siteId | path | string | yes | Site ID (site ID or site name) |
cliType | path | string | yes | CLI type should be a value as follows: 0: site CLI; 1: device CLI; 2:model CLI. Site template only supports site CLI. Site template only supports site CLI. |
Request body — application/json (required) — schema DeleteCliOpenApiVO
| Field | Type | Required | Description |
|---|---|---|---|
configIds | array<string> | no | List of IDs to be deleted. |
// omada_call_operation
{
"operationId": "deleteCliConfig",
"params": {
"siteId": "<siteId>",
"cliType": "<cliType>"
},
"body": "{...}"
}Details, permissions and error codes
Delete the CLI configuration
The interface requires one of the permissions:
Site Settings Manager Modify
Network Config Page Modify
The possible error code for the interface in the returned body is one of the following error codes (non generic error codes):
-1001 - Invalid request parameters.
-33004 - Operation failed because other operations (site copying, restoring, template synchronizing, etc.) are being performed on this site. Please wait and try again later.
getCliList
GET /openapi/v1/{omadacId}/sites/{siteId}/cli/configs/cli-type/{cliType}/device-type/{deviceType}
Get the CLI configuration list
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
omadacId | path | string | auto | Omada ID (filled in automatically) |
siteId | path | string | yes | Site ID (site ID or site name) |
cliType | path | string | yes | CLI type should be a value as follows: 0: site CLI; 1: device CLI; 2:model CLI. Site template only supports site CLI. Site template only supports site CLI. |
deviceType | path | string | yes | Device Type. Supported type: switch. |
page | query | integer | no | Start page number. Start from 1. (default 1) |
pageSize | query | integer | no | Number of entries per page. It should be within the range of 1–1000. (default 100) |
// omada_call_operation
{
"operationId": "getCliList",
"params": {
"siteId": "<siteId>",
"cliType": "<cliType>",
"deviceType": "<deviceType>"
}
}Details, permissions and error codes
Get the CLI configuration list
The interface requires one of the permissions:
Site Settings Manager View Only
Network Config Page View Only
The possible error code for the interface in the returned body is one of the following error codes (non generic error codes):
-1001 - Invalid request parameters.
-33004 - Operation failed because other operations (site copying, restoring, template synchronizing, etc.) are being performed on this site. Please wait and try again later.
applyCliConfig
POST /openapi/v1/{omadacId}/sites/{siteId}/cli/configs/config-id/{configId}/apply
Apply the CLI configuration
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
omadacId | path | string | auto | Omada ID (filled in automatically) |
siteId | path | string | yes | Site ID (site ID or site name) |
configId | path | string | yes | CLI Config ID |
// omada_call_operation
{
"operationId": "applyCliConfig",
"params": {
"siteId": "<siteId>",
"configId": "<configId>"
}
}Details, permissions and error codes
Apply the CLI configuration
The interface requires one of the permissions:
Site Settings Manager Modify
Network Config Page Modify
The possible error code for the interface in the returned body is one of the following error codes (non generic error codes):
-1001 - Invalid request parameters.
-33004 - Operation failed because other operations (site copying, restoring, template synchronizing, etc.) are being performed on this site. Please wait and try again later.
-39051 - Operation failed. Please try again later.
exportCliVariableToFile
POST /openapi/v1/{omadacId}/sites/{siteId}/cli/export/variable
Export CLI variable
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
omadacId | path | string | auto | Omada ID (filled in automatically) |
siteId | path | string | yes | Site ID (site ID or site name) |
Request body — application/json (required) — schema ExportCliVarOpenApiVO
| Field | Type | Required | Description |
|---|---|---|---|
type | integer | yes | Export type should be a value as follows: 0:CSV; 1:JSON |
devices | array<DeviceExportCliVO> | yes | Devices |
// omada_call_operation
{
"operationId": "exportCliVariableToFile",
"params": {
"siteId": "<siteId>"
},
"body": "{...}"
}Details, permissions and error codes
Export CLI variable,filename is a UTF-8 string encoded by URL Encoder
The interface requires one of the permissions:
Site Settings Manager View Only
Network Config Page View Only
The possible error code for the interface in the returned body is one of the following error codes (non generic error codes):
-1001 - Invalid request parameters.
-1004 - Invalid request type.
-33000 - This site does not exist.
-33713 - Failed to process the files.
importCliVariableToFile
POST /openapi/v1/{omadacId}/sites/{siteId}/cli/import/variable
Import CLI variable
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
omadacId | path | string | auto | Omada ID (filled in automatically) |
siteId | path | string | yes | Site ID (site ID or site name) |
Request body — application/json (optional)
| Field | Type | Required | Description |
|---|---|---|---|
file | string (binary) | yes | File must be a file in .csv or .json form |
// omada_call_operation
{
"operationId": "importCliVariableToFile",
"params": {
"siteId": "<siteId>"
},
"body": "{...}"
}Details, permissions and error codes
Import CLI variable
The interface requires one of the permissions:
Site Settings Manager View Only
Network Config Page View Only
The possible error code for the interface in the returned body is one of the following error codes (non generic error codes):
-1001 - Invalid request parameters.
-1004 - Invalid request type.
-1005 - Operation forbidden.
-30306 - Invalid files.
-33713 - Failed to process the files.
-42003 - This operator does not exist.
-42006 - Failed to log in.
getModelAndVersionListByType
GET /openapi/v1/{omadacId}/sites/{siteId}/cli/models/device-type/{deviceType}
Get model and version for model CLI.
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
omadacId | path | string | auto | Omada ID (filled in automatically) |
siteId | path | string | yes | Site ID (site ID or site name) |
deviceType | path | string | yes | Device Type. Supported type: switch. |
// omada_call_operation
{
"operationId": "getModelAndVersionListByType",
"params": {
"siteId": "<siteId>",
"deviceType": "<deviceType>"
}
}Details, permissions and error codes
Get model and version for model CLI.
The interface requires one of the permissions:
Site Settings Manager View Only
Network Config Page View Only
The possible error code for the interface in the returned body is one of the following error codes (non generic error codes):
-1001 - Invalid request parameters.