Skip to content

DNS (Template) ​

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

OperationMethodSummary
getDnsCacheSettingTemplateGETGet DNS cache setting template
getDdnsGridTemplateGETGet Dynamic DNS template list
createDdnsTemplatePOSTCreate a new Dynamic DNS template entry
deleteDdnsTemplateDELETEDelete an exist Dynamic DNS template entry
modifyDdnsTemplatePATCHModify an exist Dynamic DNS template entry
getGlobalDdnsUpdateUrlTemplateGETGet DDNS update url
modifyDnsCacheSettingTemplatePUTModify DNS cache setting
refreshDnsCacheListTemplateGETRefresh dns cache list
getDnsProxyTemplateGETGet DNS proxy template setting
modifyDnsProxyTemplatePATCHModify DNS proxy template setting

getDnsCacheSettingTemplate ​

GET /openapi/v1/{omadacId}/sitetemplates/{siteTemplateId}/dns-cache

Get DNS cache setting template

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

Get DNS cache setting template of the site template with the given omadacId and siteTemplateId.
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):
-33009 - This site template does not exist.
-33011 - Operation failed because other operations are being performed on this site template. Please wait and try again later.

getDdnsGridTemplate ​

GET /openapi/v1/{omadacId}/sitetemplates/{siteTemplateId}/setting/service/ddns

Get Dynamic DNS template list

ParameterInTypeRequiredDescription
omadacIdpathstringautoOmada ID (filled in automatically)
siteTemplateIdpathstringyesSite ID
pagequeryintegernoStart page number. Start from 1. (default 1)
pageSizequeryintegernoNumber of entries per page. It should be within the range of 1–1000. (default 100)
sorts.servicequerystringnoSort parameter may be one of asc or desc. Optional parameter. If it is not carried, it means it is not sorted by this field. When there are more than one, the first one takes effect
sorts.updateIntervalquerystringnoSort parameter may be one of asc or desc. Optional parameter. If it is not carried, it means it is not sorted by this field. When there are more than one, the first one takes effect
sorts.statusquerystringnoSort parameter may be one of asc or desc. Optional parameter. If it is not carried, it means it is not sorted by this field. When there are more than one, the first one takes effect
json
// omada_call_operation
{
  "operationId": "getDdnsGridTemplate",
  "params": {
    "siteTemplateId": "<siteTemplateId>"
  }
}
Details, permissions and error codes

Get Dynamic DNS template list of the site with the given omadacId and siteId.
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):
-33000 - This site does not exist.
-33011 - Operation failed because other operations are being performed on this site template. Please wait and try again later.

createDdnsTemplate ​

POST /openapi/v1/{omadacId}/sitetemplates/{siteTemplateId}/setting/service/ddns

Create a new Dynamic DNS template entry

ParameterInTypeRequiredDescription
omadacIdpathstringautoOmada ID (filled in automatically)
siteTemplateIdpathstringyesSite ID

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

FieldTypeRequiredDescription
serviceintegeryesDynamic DNS service type. Service should be a value as follows: 0: DynDNS, 1: NO-IP, 2: Peanuthull, 3: Comexe, 4: Custom, 5: TP-Link DDNS
statusbooleanyesDynamic DNS enable status
interfacePortIdstringyesThis field represents interface Port ID
usernamestringyesDynamic DNS username. Username should contain 1 to 128 characters
passwordstringyesDynamic DNS password. Password should contain 1 to 128 characters
domainNamestringnoDynamic DNS domainName, valid when parameter [service] is 0, 1 or 4
intervalDdnsIntervalOpenApiVOno(DdnsIntervalOpenApiVO not expanded; call omada_get_schema "DdnsIntervalOpenApiVO")
updateUrlstringnoDynamic DNS updateUrl, valid when parameter [service] is 4. Update URL must contain [USERNAME], [PASSWORD] and [DOMAIN], and Update-URL will be applied to all custom entries
json
// omada_call_operation
{
  "operationId": "createDdnsTemplate",
  "params": {
    "siteTemplateId": "<siteTemplateId>"
  },
  "body": "{...}"
}
Details, permissions and error codes

Create a new Dynamic DNS template entry with the given params.
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):
-33000 - This site does not exist.
-33011 - Operation failed because other operations are being performed on this site template. Please wait and try again later.
-34500 - Dynamic DNS Entries can be created with only one service provider for one WAN port.
-34510 - The domain name and service provider of different Dynamic DNS Entries should be different.
-34516 - The username already exists under the selected service provider.

deleteDdnsTemplate ​

DELETE /openapi/v1/{omadacId}/sitetemplates/{siteTemplateId}/setting/service/ddns/{ddnsId}

Delete an exist Dynamic DNS template entry

ParameterInTypeRequiredDescription
omadacIdpathstringautoOmada ID (filled in automatically)
siteTemplateIdpathstringyesSite ID
ddnsIdpathstringyesDynamic DNS entry ID
json
// omada_call_operation
{
  "operationId": "deleteDdnsTemplate",
  "params": {
    "siteTemplateId": "<siteTemplateId>",
    "ddnsId": "<ddnsId>"
  }
}
Details, permissions and error codes

Delete an exist Dynamic DNS template entry with the given params.
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):
-33000 - This site does not exist.
-33011 - Operation failed because other operations are being performed on this site template. Please wait and try again later.

modifyDdnsTemplate ​

PATCH /openapi/v1/{omadacId}/sitetemplates/{siteTemplateId}/setting/service/ddns/{ddnsId}

Modify an exist Dynamic DNS template entry

ParameterInTypeRequiredDescription
omadacIdpathstringautoOmada ID (filled in automatically)
siteTemplateIdpathstringyesSite ID
ddnsIdpathstringyesDynamic DNS entry ID

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

FieldTypeRequiredDescription
serviceintegeryesDynamic DNS service type. Service should be a value as follows: 0: DynDNS, 1: NO-IP, 2: Peanuthull, 3: Comexe, 4: Custom, 5: TP-Link DDNS
statusbooleanyesDynamic DNS enable status
interfacePortIdstringyesThis field represents interface Port ID
usernamestringyesDynamic DNS username. Username should contain 1 to 128 characters
passwordstringyesDynamic DNS password. Password should contain 1 to 128 characters
domainNamestringnoDynamic DNS domainName, valid when parameter [service] is 0, 1 or 4
intervalDdnsIntervalOpenApiVOno(DdnsIntervalOpenApiVO not expanded; call omada_get_schema "DdnsIntervalOpenApiVO")
updateUrlstringnoDynamic DNS updateUrl, valid when parameter [service] is 4. Update URL must contain [USERNAME], [PASSWORD] and [DOMAIN], and Update-URL will be applied to all custom entries
json
// omada_call_operation
{
  "operationId": "modifyDdnsTemplate",
  "params": {
    "siteTemplateId": "<siteTemplateId>",
    "ddnsId": "<ddnsId>"
  },
  "body": "{...}"
}
Details, permissions and error codes

Modify an exist Dynamic DNS template entry with the given params.
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):
-33000 - This site does not exist.
-33011 - Operation failed because other operations are being performed on this site template. Please wait and try again later.
-34500 - Dynamic DNS Entries can be created with only one service provider for one WAN port.
-34510 - The domain name and service provider of different Dynamic DNS Entries should be different.
-34516 - The username already exists under the selected service provider.

getGlobalDdnsUpdateUrlTemplate ​

GET /openapi/v1/{omadacId}/sitetemplates/{siteTemplateId}/setting/service/ddns/update-url

Get DDNS update url

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

Get global DDNS update url of the site with the given omadacId and siteId.
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):
-33011 - Operation failed because other operations are being performed on this site template. Please wait and try again later.

modifyDnsCacheSettingTemplate ​

PUT /openapi/v1/{omadacId}/sitetemplates/{siteTemplateId}/setting/service/dns-cache

Modify DNS cache setting

ParameterInTypeRequiredDescription
omadacIdpathstringautoOmada ID (filled in automatically)
siteTemplateIdpathstringyesSite Template ID

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

FieldTypeRequiredDescription
enablebooleannoWhether to enable DNS Cache. Options: 'true' or 'false'.
ttlintegernoTTL should be within the range of 1 or 86400.
json
// omada_call_operation
{
  "operationId": "modifyDnsCacheSettingTemplate",
  "params": {
    "siteTemplateId": "<siteTemplateId>"
  },
  "body": "{...}"
}
Details, permissions and error codes

Modify DNS cache setting
The interface requires one of the permissions:
Global Site Template Manager Modify

refreshDnsCacheListTemplate ​

GET /openapi/v1/{omadacId}/sitetemplates/{siteTemplateId}/setting/service/dns-cache-data/refresh

Refresh dns cache list

ParameterInTypeRequiredDescription
omadacIdpathstringautoOmada ID (filled in automatically)
siteTemplateIdpathstringyesSite Template ID
voqueryDnsCacheQueryOpenApiVOnoObject: its fields (page, pageSize, type) are sent as separate query parameters.
json
// omada_call_operation
{
  "operationId": "refreshDnsCacheListTemplate",
  "params": {
    "siteTemplateId": "<siteTemplateId>"
  }
}
Details, permissions and error codes

Send refresh command to devices and refresh dns cache list.
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):
-33011 - Operation failed because other operations are being performed on this site template. Please wait and try again later.
-34548 - No data. Please enable DNS Cache first.
-34549 - No data. Please make sure the gateway is online.
-39501 - This gateway does not exist.

getDnsProxyTemplate ​

GET /openapi/v1/{omadacId}/sitetemplates/{siteTemplateId}/setting/service/dns-proxy

Get DNS proxy template setting

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

Get DNS proxy template setting of the site with the given omadacId and siteId.
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):
-33000 - This site does not exist.
-33011 - Operation failed because other operations are being performed on this site template. Please wait and try again later.

modifyDnsProxyTemplate ​

PATCH /openapi/v1/{omadacId}/sitetemplates/{siteTemplateId}/setting/service/dns-proxy

Modify DNS proxy template setting

ParameterInTypeRequiredDescription
omadacIdpathstringautoOmada ID (filled in automatically)
siteTemplateIdpathstringyesSite ID

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

FieldTypeRequiredDescription
enablebooleanyesDNS proxy setting enable status
typeintegernoDNS proxy setting type. Type should be a value as follows: 0: DNSSEC, 1: DoH, 2: DoT, 3: DNS Override
dnsSecSettingDnsSecSettingOpenApiVOno(DnsSecSettingOpenApiVO not expanded; call omada_get_schema "DnsSecSettingOpenApiVO")
dohSettingDohSettingOpenApiVOno(DohSettingOpenApiVO not expanded; call omada_get_schema "DohSettingOpenApiVO")
dotSettingDotSettingOpenApiVOno(DotSettingOpenApiVO not expanded; call omada_get_schema "DotSettingOpenApiVO")
dnsOverrideSettingDnsOverrideSettingOpenApiVOno(DnsOverrideSettingOpenApiVO not expanded; call omada_get_schema "DnsOverrideSettingOpenApiVO")
json
// omada_call_operation
{
  "operationId": "modifyDnsProxyTemplate",
  "params": {
    "siteTemplateId": "<siteTemplateId>"
  },
  "body": "{...}"
}
Details, permissions and error codes

Modify DNS proxy template setting info of the site with the given params.
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):
-33000 - This site does not exist.
-33011 - Operation failed because other operations are being performed on this site template. Please wait and try again later.
-34536 - Please enable at least one DNS Sec server.
-34538 - The number of custom DNS servers has reached the limit.
-34539 - Please enable at least one DoH server.
-34540 - Please enable at least one DoT server.
-34578 - The Gateway dose not support the type Override
-34579 - The Gateway dose not support DNS proxy
-34588 - Please select a network.
-34589 - The selected network ID does not exist.
-34590 - Invalid IP address in DNS Server.

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