Add System service
This commit is contained in:
parent
79d5f4c1f9
commit
52cb85786d
|
@ -0,0 +1,22 @@
|
||||||
|
<?php
|
||||||
|
namespace alphayax\freebox\api\v3;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class Model
|
||||||
|
* @package alphayax\freebox\api\v3
|
||||||
|
*/
|
||||||
|
abstract class Model {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Model constructor.
|
||||||
|
* @param array $properties_x mapping of properties
|
||||||
|
*/
|
||||||
|
public function __construct( $properties_x = []){
|
||||||
|
foreach( $properties_x as $property => $value){
|
||||||
|
if( property_exists( static::class, $property)){
|
||||||
|
$this->$property = $value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -1,5 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
namespace alphayax\freebox\api\v3\config;
|
namespace alphayax\freebox\api\v3\config;
|
||||||
|
use alphayax\freebox\api\v3\models\DhcpConfig;
|
||||||
use alphayax\freebox\api\v3\Service;
|
use alphayax\freebox\api\v3\Service;
|
||||||
|
|
||||||
|
|
||||||
|
@ -19,7 +20,7 @@ class DHCP extends Service {
|
||||||
$rest = $this->getAuthService( self::API_DHCP_CONFIG);
|
$rest = $this->getAuthService( self::API_DHCP_CONFIG);
|
||||||
$rest->GET();
|
$rest->GET();
|
||||||
|
|
||||||
return $rest->getCurlResponse();
|
return new DhcpConfig( $rest->getCurlResponse()['result']);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -0,0 +1,35 @@
|
||||||
|
<?php
|
||||||
|
namespace alphayax\freebox\api\v3\models;
|
||||||
|
use alphayax\freebox\api\v3\Model;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class DhcpConfig
|
||||||
|
* @package alphayax\freebox\api\v3\models
|
||||||
|
*/
|
||||||
|
class DhcpConfig extends Model {
|
||||||
|
|
||||||
|
/** @var bool Enable/Disable the DHCP server */
|
||||||
|
protected $enabled;
|
||||||
|
|
||||||
|
/** @var bool Always assign the same IP to a given host */
|
||||||
|
protected $sticky_assign;
|
||||||
|
|
||||||
|
/** @var string (Read-only) Gateway IP address */
|
||||||
|
protected $gateway;
|
||||||
|
|
||||||
|
/** @var string (Read-only) Gateway subnet netmask */
|
||||||
|
protected $netmask;
|
||||||
|
|
||||||
|
/** @var string DHCP range start IP */
|
||||||
|
protected $ip_range_start;
|
||||||
|
|
||||||
|
/** @var string DHCP range end IP */
|
||||||
|
protected $ip_range_end;
|
||||||
|
|
||||||
|
/** @var bool Always broadcast DHCP responses */
|
||||||
|
protected $always_broadcast;
|
||||||
|
|
||||||
|
/** @var array of string List of dns servers to include in DHCP reply */
|
||||||
|
protected $dns = [];
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue