Skip to content

Bluscream/adguardhome-php

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SwaggerClient-php

AdGuard Home REST-ish API. Our admin web interface is built on top of this REST-ish API.

This PHP package is automatically generated by the Swagger Codegen project:

Requirements

PHP 5.5 and later

Installation & Usage

Composer

To install the bindings via Composer, add the following to composer.json:

{
  "repositories": [
    {
      "type": "git",
      "url": "https://github.com/GIT_USER_ID/GIT_REPO_ID.git"
    }
  ],
  "require": {
    "GIT_USER_ID/GIT_REPO_ID": "*@dev"
  }
}

Then run composer install

Manual Installation

Download the files and include autoload.php:

    require_once('/path/to/SwaggerClient-php/vendor/autoload.php');

Tests

To run the unit tests:

composer install
./vendor/bin/phpunit

Getting Started

Please follow the installation procedure and then run the following:

<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure HTTP basic authorization: basicAuth
$config = Swagger\Client\Configuration::getDefaultConfiguration()
    ->setUsername('YOUR_USERNAME')
    ->setPassword('YOUR_PASSWORD');

$apiInstance = new Swagger\Client\Api\BlockedServicesApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);

try {
    $result = $apiInstance->blockedServicesList();
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling BlockedServicesApi->blockedServicesList: ', $e->getMessage(), PHP_EOL;
}
// Configure HTTP basic authorization: basicAuth
$config = Swagger\Client\Configuration::getDefaultConfiguration()
    ->setUsername('YOUR_USERNAME')
    ->setPassword('YOUR_PASSWORD');

$apiInstance = new Swagger\Client\Api\BlockedServicesApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$body = array("body_example"); // string[] | 

try {
    $apiInstance->blockedServicesSet($body);
} catch (Exception $e) {
    echo 'Exception when calling BlockedServicesApi->blockedServicesSet: ', $e->getMessage(), PHP_EOL;
}
?>

Documentation for API Endpoints

All URIs are relative to /control

Class Method HTTP request Description
BlockedServicesApi blockedServicesList GET /blocked_services/list Get blocked services list
BlockedServicesApi blockedServicesSet POST /blocked_services/set Set blocked services list
ClientsApi accessList GET /access/list List (dis)allowed clients, blocked hosts, etc.
ClientsApi accessSet POST /access/set Set (dis)allowed clients, blocked hosts, etc.
ClientsApi clientsAdd POST /clients/add Add a new client
ClientsApi clientsDelete POST /clients/delete Remove a client
ClientsApi clientsFind GET /clients/find Get information about clients by their IP addresses or ClientIDs.
ClientsApi clientsStatus GET /clients Get information about configured clients
ClientsApi clientsUpdate POST /clients/update Update client information
DhcpApi checkActiveDhcp POST /dhcp/find_active_dhcp Searches for an active DHCP server on the network
DhcpApi dhcpAddStaticLease POST /dhcp/add_static_lease Adds a static lease
DhcpApi dhcpInterfaces GET /dhcp/interfaces Gets the available interfaces
DhcpApi dhcpRemoveStaticLease POST /dhcp/remove_static_lease Removes a static lease
DhcpApi dhcpReset POST /dhcp/reset Reset DHCP configuration
DhcpApi dhcpResetLeases POST /dhcp/reset_leases Reset DHCP leases
DhcpApi dhcpSetConfig POST /dhcp/set_config Updates the current DHCP server configuration
DhcpApi dhcpStatus GET /dhcp/status Gets the current DHCP settings and status
FilteringApi filteringAddURL POST /filtering/add_url Add filter URL or an absolute file path
FilteringApi filteringCheckHost GET /filtering/check_host Check if host name is filtered
FilteringApi filteringConfig POST /filtering/config Set filtering parameters
FilteringApi filteringRefresh POST /filtering/refresh Reload filtering rules from URLs. This might be needed if new URL was just added and you don't want to wait for automatic refresh to kick in. This API request is ratelimited, so you can call it freely as often as you like, it wont create unnecessary burden on servers that host the URL. This should work as intended, a `force` parameter is offered as last-resort attempt to make filter lists fresh. If you ever find yourself using `force` to make something work that otherwise wont, this is a bug and report it accordingly.
FilteringApi filteringRemoveURL POST /filtering/remove_url Remove filter URL
FilteringApi filteringSetRules POST /filtering/set_rules Set user-defined filter rules
FilteringApi filteringSetURL POST /filtering/set_url Set URL parameters
FilteringApi filteringStatus GET /filtering/status Get filtering parameters
GlobalApi beginUpdate POST /update Begin auto-upgrade procedure
GlobalApi dnsConfig POST /dns_config Set general DNS parameters
GlobalApi dnsInfo GET /dns_info Get general DNS parameters
GlobalApi getProfile GET /profile
GlobalApi getVersionJson POST /version.json Gets information about the latest available version of AdGuard
GlobalApi login POST /login Perform administrator log-in
GlobalApi logout GET /logout Perform administrator log-out
GlobalApi mobileConfigDoH GET /apple/doh.mobileconfig Get DNS over HTTPS .mobileconfig.
GlobalApi mobileConfigDoT GET /apple/dot.mobileconfig Get DNS over TLS .mobileconfig.
GlobalApi status GET /status Get DNS server current status and general settings
GlobalApi testUpstreamDNS POST /test_upstream_dns Test upstream configuration
I18nApi changeLanguage POST /i18n/change_language Change current language. Argument must be an ISO 639-1 two-letter code.
I18nApi currentLanguage GET /i18n/current_language Get currently set language. Result is ISO 639-1 two-letter code. Empty result means default language.
InstallApi installCheckConfig POST /install/check_config Checks configuration
InstallApi installCheckConfigBeta POST /install/check_config_beta 'UNSTABLE!: Checks configuration'
InstallApi installConfigure POST /install/configure Applies the initial configuration.
InstallApi installConfigureBeta POST /install/configure_beta 'UNSTABLE!: Applies the initial configuration.'
InstallApi installGetAddresses GET /install/get_addresses Gets the network interfaces information.
InstallApi installGetAddressesBeta GET /install/get_addresses_beta 'UNSTABLE!: Gets the network interfaces information.'
LogApi queryLog GET /querylog Get DNS server query log.
LogApi queryLogConfig POST /querylog_config Set query log parameters
LogApi queryLogInfo GET /querylog_info Get query log parameters
LogApi querylogClear POST /querylog_clear Clear query log
MobileconfigApi mobileConfigDoH GET /apple/doh.mobileconfig Get DNS over HTTPS .mobileconfig.
MobileconfigApi mobileConfigDoT GET /apple/dot.mobileconfig Get DNS over TLS .mobileconfig.
ParentalApi parentalDisable POST /parental/disable Disable parental filtering
ParentalApi parentalEnable POST /parental/enable Enable parental filtering
ParentalApi parentalStatus GET /parental/status Get parental filtering status
RewriteApi rewriteAdd POST /rewrite/add Add a new Rewrite rule
RewriteApi rewriteDelete POST /rewrite/delete Remove a Rewrite rule
RewriteApi rewriteList GET /rewrite/list Get list of Rewrite rules
SafebrowsingApi safebrowsingDisable POST /safebrowsing/disable Disable safebrowsing
SafebrowsingApi safebrowsingEnable POST /safebrowsing/enable Enable safebrowsing
SafebrowsingApi safebrowsingStatus GET /safebrowsing/status Get safebrowsing status
SafesearchApi safesearchDisable POST /safesearch/disable Disable safesearch
SafesearchApi safesearchEnable POST /safesearch/enable Enable safesearch
SafesearchApi safesearchStatus GET /safesearch/status Get safesearch status
StatsApi stats GET /stats Get DNS server statistics
StatsApi statsConfig POST /stats_config Set statistics parameters
StatsApi statsInfo GET /stats_info Get statistics parameters
StatsApi statsReset POST /stats_reset Reset all statistics to zeroes
TlsApi tlsConfigure POST /tls/configure Updates current TLS configuration
TlsApi tlsStatus GET /tls/status Returns TLS configuration and its status
TlsApi tlsValidate POST /tls/validate Checks if the current TLS configuration is valid

Documentation For Models

Documentation For Authorization

basicAuth

  • Type: HTTP basic authentication

Author

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published