mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-31 01:34:12 +02:00
ImportCommand: initial implementation
This commit is contained in:
parent
f9ca11eb50
commit
34bff74797
54
application/clicommands/ImportCommand.php
Normal file
54
application/clicommands/ImportCommand.php
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Icinga\Module\Director\Clicommands;
|
||||||
|
|
||||||
|
use Icinga\Module\Director\Cli\Command;
|
||||||
|
use Icinga\Module\Director\DirectorObject\Automation\ImportExport;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Export Director Config Objects
|
||||||
|
*/
|
||||||
|
class ImportCommand extends Command
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Export all ImportSource definitions
|
||||||
|
*
|
||||||
|
* Use this command to delete a single Icinga object
|
||||||
|
*
|
||||||
|
* USAGE
|
||||||
|
*
|
||||||
|
* icingacli director import importsource [options]
|
||||||
|
*
|
||||||
|
* OPTIONS
|
||||||
|
*
|
||||||
|
* --no-pretty JSON is pretty-printed per default
|
||||||
|
* Use this flag to enforce unformatted JSON
|
||||||
|
*/
|
||||||
|
public function importsourceAction()
|
||||||
|
{
|
||||||
|
$json = file_get_contents('php://stdin');
|
||||||
|
$export = new ImportExport($this->db());
|
||||||
|
$export->unserializeImportSources(json_decode($json));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Import SyncRule definitions
|
||||||
|
*
|
||||||
|
* Use this command to import ....
|
||||||
|
*
|
||||||
|
* USAGE
|
||||||
|
*
|
||||||
|
* icingacli director syncrule export [options]
|
||||||
|
*
|
||||||
|
* OPTIONS
|
||||||
|
*
|
||||||
|
* --no-pretty JSON is pretty-printed per default
|
||||||
|
* Use this flag to enforce unformatted JSON
|
||||||
|
*/
|
||||||
|
public function syncruleAction()
|
||||||
|
{
|
||||||
|
$json = file_get_contents('php://stdin');
|
||||||
|
$export = new ImportExport($this->db());
|
||||||
|
$export->unserializeSyncRules(json_decode($json));
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user