Skip to content

CLI (Template) ​

6 operations. Call any of them with omada_call_operation (or, in full tool mode, as a tool named by its operationId).

OperationMethodSummary
getCliConfigTemplateGETGet the CLI template configuration content
modifyCliConfigTemplatePATCHModify the CLI template configuration content
createCliConfigTemplatePOSTCreate a new CLI template configuration
deleteCliConfigTemplateDELETEDelete the CLI template configuration
getGridCliTemplateGETGet the CLI template configuration list
applyCliConfigTemplatePOSTApply the CLI template configuration

getCliConfigTemplate ​

GET /openapi/v1/{omadacId}/sitetemplates/{siteTemplateId}/cli/config/cli-type/{cliType}/config-id/{configId}

Get the CLI template configuration content

ParameterInTypeRequiredDescription
omadacIdpathstringautoOmada ID (filled in automatically)
siteTemplateIdpathstringyesSite ID
cliTypepathstringyesCLI 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.
configIdpathstringyesCLI Config ID
json
// omada_call_operation
{
  "operationId": "getCliConfigTemplate",
  "params": {
    "siteTemplateId": "<siteTemplateId>",
    "cliType": "<cliType>",
    "configId": "<configId>"
  }
}
Details, permissions and error codes

Get the CLI template configuration content
The interface requires one of the permissions:
Global Site Template Manager 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.
-33011 - Operation failed because other operations are being performed on this site template. Please wait and try again later.

modifyCliConfigTemplate ​

PATCH /openapi/v1/{omadacId}/sitetemplates/{siteTemplateId}/cli/config/cli-type/{cliType}/config-id/{configId}

Modify the CLI template configuration content

ParameterInTypeRequiredDescription
omadacIdpathstringautoOmada ID (filled in automatically)
siteTemplateIdpathstringyesSite ID
cliTypepathstringyesCLI 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.
configIdpathstringyesCLI Config ID

Request body — application/json (required) — schema ModifyCliTemplateOpenApiVO

FieldTypeRequiredDescription
namestringyesCLI configuration name, it should be within the range of 1 - 64 characters
deviceTypestringyesDevice type for CLI configuration application, it should be a value as follows: switch.
descriptionstringnoCLI configuration description, it should be within the range of 0 - 256 characters.
cliConfigstringyesCLI configuration content
json
// omada_call_operation
{
  "operationId": "modifyCliConfigTemplate",
  "params": {
    "siteTemplateId": "<siteTemplateId>",
    "cliType": "<cliType>",
    "configId": "<configId>"
  },
  "body": "{...}"
}
Details, permissions and error codes

Modify the CLI template configuration content
The interface requires one of the permissions:
Global Site Template Manager 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.
-33011 - Operation failed because other operations are being performed on this site template. Please wait and try again later.

createCliConfigTemplate ​

POST /openapi/v1/{omadacId}/sitetemplates/{siteTemplateId}/cli/config/cli-type/{cliType}/save

Create a new CLI template configuration

ParameterInTypeRequiredDescription
omadacIdpathstringautoOmada ID (filled in automatically)
siteTemplateIdpathstringyesSite ID
cliTypepathstringyesCLI 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 ModifyCliTemplateOpenApiVO

FieldTypeRequiredDescription
namestringyesCLI configuration name, it should be within the range of 1 - 64 characters
deviceTypestringyesDevice type for CLI configuration application, it should be a value as follows: switch.
descriptionstringnoCLI configuration description, it should be within the range of 0 - 256 characters.
cliConfigstringyesCLI configuration content
json
// omada_call_operation
{
  "operationId": "createCliConfigTemplate",
  "params": {
    "siteTemplateId": "<siteTemplateId>",
    "cliType": "<cliType>"
  },
  "body": "{...}"
}
Details, permissions and error codes

Create a new CLI template configuration
The interface requires one of the permissions:
Global Site Template Manager 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.
-33011 - Operation failed because other operations are being performed on this site template. Please wait and try again later.

deleteCliConfigTemplate ​

DELETE /openapi/v1/{omadacId}/sitetemplates/{siteTemplateId}/cli/configs/cli-type/{cliType}

Delete the CLI template configuration

ParameterInTypeRequiredDescription
omadacIdpathstringautoOmada ID (filled in automatically)
siteTemplateIdpathstringyesSite ID
cliTypepathstringyesCLI 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 DeleteCliTemplateOpenApiVO

FieldTypeRequiredDescription
configIdstringnoCLI ID to be deleted.
json
// omada_call_operation
{
  "operationId": "deleteCliConfigTemplate",
  "params": {
    "siteTemplateId": "<siteTemplateId>",
    "cliType": "<cliType>"
  },
  "body": "{...}"
}
Details, permissions and error codes

Delete the CLI template configuration
The interface requires one of the permissions:
Global Site Template Manager 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.
-33011 - Operation failed because other operations are being performed on this site template. Please wait and try again later.

getGridCliTemplate ​

GET /openapi/v1/{omadacId}/sitetemplates/{siteTemplateId}/cli/configs/cli-type/{cliType}/device-type/{deviceType}

Get the CLI template configuration list

ParameterInTypeRequiredDescription
omadacIdpathstringautoOmada ID (filled in automatically)
siteTemplateIdpathstringyesSite ID
cliTypepathstringyesCLI 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.
deviceTypepathstringyesDevice Type. Supported type: switch.
pagequeryintegernoStart page number. Start from 1. (default 1)
pageSizequeryintegernoNumber of entries per page. It should be within the range of 1–1000. (default 100)
json
// omada_call_operation
{
  "operationId": "getGridCliTemplate",
  "params": {
    "siteTemplateId": "<siteTemplateId>",
    "cliType": "<cliType>",
    "deviceType": "<deviceType>"
  }
}
Details, permissions and error codes

Get the CLI template configuration list
The interface requires one of the permissions:
Global Site Template Manager 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.
-33011 - Operation failed because other operations are being performed on this site template. Please wait and try again later.

applyCliConfigTemplate ​

POST /openapi/v1/{omadacId}/sitetemplates/{siteTemplateId}/cli/configs/config-id/{configId}/apply

Apply the CLI template configuration

ParameterInTypeRequiredDescription
omadacIdpathstringautoOmada ID (filled in automatically)
siteTemplateIdpathstringyesSite ID
configIdpathstringyesCLI Config ID
json
// omada_call_operation
{
  "operationId": "applyCliConfigTemplate",
  "params": {
    "siteTemplateId": "<siteTemplateId>",
    "configId": "<configId>"
  }
}
Details, permissions and error codes

Apply the CLI template configuration
The interface requires one of the permissions:
Global Site Template Manager 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.
-33011 - Operation failed because other operations are being performed on this site template. Please wait and try again later.
-39051 - Operation failed. Please try again later.

Released under the MIT License. Not affiliated with or endorsed by TP-Link.