|
|
@ -49,6 +49,11 @@ interface ClientInterface |
|
|
public const ATTEMPTS_DELAY = 1; |
|
|
public const ATTEMPTS_DELAY = 1; |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
|
|
|
* Delay between attempts in seconds |
|
|
|
|
|
*/ |
|
|
|
|
|
public const SSH_PORT = 22; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
* Return socket resource if is exist |
|
|
* Return socket resource if is exist |
|
|
* |
|
|
* |
|
|
* @return resource |
|
|
* @return resource |
|
|
@ -58,7 +63,14 @@ interface ClientInterface |
|
|
/** |
|
|
/** |
|
|
* Read answer from server after query was executed |
|
|
* Read answer from server after query was executed |
|
|
* |
|
|
* |
|
|
|
|
|
* A Mikrotik reply is formed of blocks |
|
|
|
|
|
* Each block starts with a word, one of ('!re', '!trap', '!done', '!fatal') |
|
|
|
|
|
* Each block end with an zero byte (empty line) |
|
|
|
|
|
* Reply ends with a complete !done or !fatal block (ended with 'empty line') |
|
|
|
|
|
* A !fatal block precedes TCP connexion close |
|
|
|
|
|
* |
|
|
* @param bool $parse |
|
|
* @param bool $parse |
|
|
|
|
|
* |
|
|
* @return mixed |
|
|
* @return mixed |
|
|
*/ |
|
|
*/ |
|
|
public function read(bool $parse); |
|
|
public function read(bool $parse); |
|
|
@ -67,7 +79,10 @@ interface ClientInterface |
|
|
* Send write query to RouterOS |
|
|
* Send write query to RouterOS |
|
|
* |
|
|
* |
|
|
* @param string|array|\RouterOS\Query $query |
|
|
* @param string|array|\RouterOS\Query $query |
|
|
|
|
|
* |
|
|
* @return \RouterOS\Client |
|
|
* @return \RouterOS\Client |
|
|
|
|
|
* @throws \RouterOS\Exceptions\QueryException |
|
|
|
|
|
* @deprecated |
|
|
*/ |
|
|
*/ |
|
|
public function write($query): Client; |
|
|
public function write($query): Client; |
|
|
|
|
|
|
|
|
@ -78,9 +93,21 @@ interface ClientInterface |
|
|
* @param array|null $where List of where filters |
|
|
* @param array|null $where List of where filters |
|
|
* @param string|null $operations Some operations which need make on response |
|
|
* @param string|null $operations Some operations which need make on response |
|
|
* @param string|null $tag Mark query with tag |
|
|
* @param string|null $tag Mark query with tag |
|
|
* @return \RouterOS\Client |
|
|
|
|
|
|
|
|
* |
|
|
|
|
|
* @return \RouterOS\Interfaces\ClientInterface |
|
|
* @throws \RouterOS\Exceptions\QueryException |
|
|
* @throws \RouterOS\Exceptions\QueryException |
|
|
* @since 1.0.0 |
|
|
* @since 1.0.0 |
|
|
*/ |
|
|
*/ |
|
|
public function query($endpoint, array $where, string $operations, string $tag): Client; |
|
|
|
|
|
|
|
|
public function query($endpoint, array $where, string $operations, string $tag): ClientInterface; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* Execute export command on remote host |
|
|
|
|
|
* |
|
|
|
|
|
* @return string |
|
|
|
|
|
* @throws \RouterOS\Exceptions\ConfigException |
|
|
|
|
|
* @throws \RuntimeException |
|
|
|
|
|
* |
|
|
|
|
|
* @since 1.3.0 |
|
|
|
|
|
*/ |
|
|
|
|
|
public function export(): string; |
|
|
} |
|
|
} |