unifi: list networks and set the DNS their DHCP hands out
Which DNS server the home network's DHCP hands out could be changed only in the controller's own interface or by hand against its API (novox/hq issue 198).
This commit is contained in:
@@ -23,6 +23,19 @@ export interface UnifiPortForward {
|
||||
site_id?: string;
|
||||
}
|
||||
|
||||
export interface UnifiNetwork {
|
||||
_id: string;
|
||||
name: string;
|
||||
purpose: string;
|
||||
ip_subnet?: string;
|
||||
dhcpd_enabled?: boolean;
|
||||
dhcpd_dns_enabled?: boolean;
|
||||
dhcpd_dns_1?: string;
|
||||
dhcpd_dns_2?: string;
|
||||
dhcpd_dns_3?: string;
|
||||
dhcpd_dns_4?: string;
|
||||
}
|
||||
|
||||
export interface UnifiDevice {
|
||||
_id: string;
|
||||
name: string;
|
||||
@@ -232,6 +245,17 @@ export class UnifiApiClient {
|
||||
await this.request<unknown>("DELETE", `/api/s/${this.site}/rest/portforward/${id}`);
|
||||
}
|
||||
|
||||
// --- Networks ---
|
||||
|
||||
async listNetworks(): Promise<UnifiNetwork[]> {
|
||||
return this.request<UnifiNetwork>("GET", `/api/s/${this.site}/rest/networkconf`);
|
||||
}
|
||||
|
||||
async updateNetwork(id: string, fields: Partial<UnifiNetwork>): Promise<UnifiNetwork> {
|
||||
const result = await this.request<UnifiNetwork>("PUT", `/api/s/${this.site}/rest/networkconf/${id}`, fields);
|
||||
return result[0];
|
||||
}
|
||||
|
||||
// --- Devices ---
|
||||
|
||||
async listDevices(): Promise<UnifiDevice[]> {
|
||||
|
||||
Reference in New Issue
Block a user