appService = new AppService; parent::__construct(); } protected function configure() { $this->setDescription('Get the endpoints.'); } /** * @param InputInterface $input * @param OutputInterface $output * @return int */ protected function execute(InputInterface $input, OutputInterface $output) { $ydb = $this->appService->initYdb(); $result = $ydb->retry(function (Ydb $ydb) use ($output) { $discovery = $ydb->discovery(); return $discovery->listEndpoints(); }, true); $output->writeln(json_encode($result, 480)); return Command::SUCCESS; } }