mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-30 01:04:12 +02:00
Importsources: remove dummy, allow import / export
This commit is contained in:
parent
17321e4a5f
commit
5be3f092a9
@ -30,10 +30,10 @@ class ImportsourcesController extends ActionController
|
||||
if ($this->getRequest()->isApiRequest()) {
|
||||
switch (strtolower($this->getRequest()->getMethod())) {
|
||||
case 'get':
|
||||
throw new \RuntimeException('sdaf');
|
||||
$this->sendExport();
|
||||
break;
|
||||
case 'post':
|
||||
$this->import($this->getRequest()->getRawBody());
|
||||
$this->acceptImport($this->getRequest()->getRawBody());
|
||||
break;
|
||||
// TODO: put / replace all?
|
||||
default:
|
||||
@ -53,6 +53,15 @@ class ImportsourcesController extends ActionController
|
||||
(new ImportsourceTable($this->db()))->renderTo($this);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $raw
|
||||
* @throws \Icinga\Exception\ConfigurationError
|
||||
*/
|
||||
protected function acceptImport(& $raw)
|
||||
{
|
||||
(new ImportExport($this->db()))->unserializeImportSources(json_decode($raw));
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws \Icinga\Exception\ConfigurationError
|
||||
*/
|
||||
|
Loading…
x
Reference in New Issue
Block a user