Method | HTTP request | Description |
---|---|---|
installCheckConfig | POST /install/check_config | Checks configuration |
installConfigure | POST /install/configure | Applies the initial configuration. |
installGetAddresses | GET /install/get_addresses | Gets the network interfaces information. |
CheckConfigResponse installCheckConfig(checkConfigRequest)
import { createConfiguration, ServerConfiguration, InstallApi, InstallApiInstallCheckConfigRequest } from 'adguardhome';
import * as fs from 'fs';
const configuration = createConfiguration({
baseServer: new ServerConfiguration("http://adguarghome-ip/control/"),
authMethods: {
basicAuth: {
username: "user",
password: "pass"
}
}
});
const apiInstance = new InstallApi(configuration);
let body:InstallApiInstallCheckConfigRequest = {
// CheckConfigRequest | Configuration to be checked
checkConfigRequest: {
dns: {
ip: "127.0.0.1",
port: 53,
autofix: false,
},
web: {
ip: "127.0.0.1",
port: 53,
autofix: false,
},
setStaticIp: false,
},
};
apiInstance.installCheckConfig(body).then((data:any) => {
console.log('API called successfully. Returned data: ' + data);
}).catch((error:any) => console.error(error));
Name | Type | Description | Notes |
---|---|---|---|
checkConfigRequest | CheckConfigRequest | Configuration to be checked |
CheckConfigResponse
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | OK. | - |
400 | Failed to parse JSON or cannot listen on the specified address. | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
void installConfigure(initialConfiguration)
import { createConfiguration, ServerConfiguration, InstallApi, InstallApiInstallCheckConfigRequest } from 'adguardhome';
import * as fs from 'fs';
const configuration = createConfiguration({
baseServer: new ServerConfiguration("http://adguarghome-ip/control/"),
authMethods: {
basicAuth: {
username: "user",
password: "pass"
}
}
});
const apiInstance = new InstallApi(configuration);
let body:InstallApiInstallConfigureRequest = {
// InitialConfiguration | Initial configuration JSON
initialConfiguration: {
dns: {
ip: "127.0.0.1",
port: 53,
},
web: {
ip: "127.0.0.1",
port: 53,
},
username: "admin",
password: "password",
},
};
apiInstance.installConfigure(body).then((data:any) => {
console.log('API called successfully. Returned data: ' + data);
}).catch((error:any) => console.error(error));
Name | Type | Description | Notes |
---|---|---|---|
initialConfiguration | InitialConfiguration | Initial configuration JSON |
void
- Content-Type: application/json
- Accept: Not defined
Status code | Description | Response headers |
---|---|---|
200 | OK. | - |
400 | Failed to parse initial configuration or cannot listen to the specified addresses. | - |
422 | The specified password does not meet the strength requirements. | - |
500 | Cannot start the DNS server | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
AddressesInfo installGetAddresses()
import { createConfiguration, ServerConfiguration, InstallApi } from 'adguardhome';
import * as fs from 'fs';
const configuration = createConfiguration({
baseServer: new ServerConfiguration("http://adguarghome-ip/control/"),
authMethods: {
basicAuth: {
username: "user",
password: "pass"
}
}
});
const apiInstance = new InstallApi(configuration);
let body:any = {};
apiInstance.installGetAddresses(body).then((data:any) => {
console.log('API called successfully. Returned data: ' + data);
}).catch((error:any) => console.error(error));
This endpoint does not need any parameter.
AddressesInfo
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | OK. | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]