Exemplo n.º 1
0
 /**
  * Action for Testing configuration files
  *
  * @method GET
  * @route /movecfg/[i:id]
  */
 public static function moveAction()
 {
     $di = Di::getDefault();
     $router = $di->get('router');
     $param = $router->request()->paramsNamed();
     $obj = new ConfigMoveRepository($param["id"]);
     $obj->moveConfig();
     $router->response()->json(array("status" => $obj->getStatus(), "output" => $obj->getOutput()));
 }
Exemplo n.º 2
0
 /**
  * @cmdObject string poller the poller slug
  */
 public function moveAction($object)
 {
     $exit = 1;
     $id = PollerRepository::getIdBySlugName($object['poller']);
     if (!is_null($id)) {
         $obj = new ConfigMoveRepository($id);
         $obj->moveConfig();
         echo $obj->getOutput();
         if ($obj->getStatus() === 1) {
             $exit = 0;
         } else {
             $exit = 1;
         }
     } else {
         \Centreon\Internal\Utils\CommandLine\InputOutput::display("Error : Poller not in Database", true, 'red');
         $exit = 1;
     }
     exit($exit);
 }