Add /api/client/servers/{server}/files/chmod endpoint
This commit is contained in:
parent
77abfd01ec
commit
8611ebb2d6
4 changed files with 80 additions and 0 deletions
|
@ -269,4 +269,32 @@ class DaemonFileRepository extends DaemonRepository
|
|||
throw new DaemonConnectionException($exception);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Chmods the given files.
|
||||
*
|
||||
* @param string|null $root
|
||||
* @param array $files
|
||||
* @return \Psr\Http\Message\ResponseInterface
|
||||
*
|
||||
* @throws \Pterodactyl\Exceptions\Http\Connection\DaemonConnectionException
|
||||
*/
|
||||
public function chmodFiles(?string $root, array $files): ResponseInterface
|
||||
{
|
||||
Assert::isInstanceOf($this->server, Server::class);
|
||||
|
||||
try {
|
||||
return $this->getHttpClient()->post(
|
||||
sprintf('/api/servers/%s/files/chmod', $this->server->uuid),
|
||||
[
|
||||
'json' => [
|
||||
'root' => $root ?? '/',
|
||||
'files' => $files,
|
||||
],
|
||||
]
|
||||
);
|
||||
} catch (TransferException $exception) {
|
||||
throw new DaemonConnectionException($exception);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Reference in a new issue