This commit is contained in:
Simon Vieille 2015-02-23 21:36:20 +01:00
parent fd104faef3
commit 2e1277668d
15 changed files with 73 additions and 57 deletions

View File

@ -19,10 +19,25 @@ class DomainAddCommand extends AbstractCommand
$this
->setName('domain:add')
->setDescription('Add a domain')
->addOption('name', null, InputOption::VALUE_REQUIRED, '')
->addOption('type', null, InputOption::VALUE_REQUIRED, '')
->addOption('master', null, InputOption::VALUE_REQUIRED, '')
->setHelp("The <info>%command.name%</info> ");
->addOption('name', null, InputOption::VALUE_REQUIRED, 'Domain name')
->addOption('type', null, InputOption::VALUE_REQUIRED, 'Domain type')
->addOption('master', null, InputOption::VALUE_REQUIRED, 'Domain master')
->setHelp("<info>%command.name%</info>
<info>--master</info>
This describes the master nameserver from which this domain should be slaved. Takes IPs, not hostnames!
USe \"null\" to set NULL value
<info>--type</info>
Posible values are: <comment>NATIVE</comment>, <comment>MASTER</comment>, <comment>SLAVE</comment>, <comment>SUPERSLAVE</comment>
Recommaned value: NATIVE
For reference to the generated querys check: MASTER-SLAVE-QUERIES
<comment>https://doc.powerdns.com/md/authoritative/backend-generic-mypgsql/#MASTER-SLAVE-QUERIES</comment>
Use \"null\" to set NULL value.");
}
protected function execute(InputInterface $input, OutputInterface $output)

View File

@ -18,10 +18,9 @@ class DomainListCommand extends AbstractCommand
$this
->setName('domain:list')
->setDescription('List domains')
->addOption('short', null, InputOption::VALUE_NONE, '')
->addOption('zone', null, InputOption::VALUE_NONE, '')
->addOption('active', null, InputOption::VALUE_NONE, '')
->setHelp("The <info>%command.name%</info> ");
->addOption('short', null, InputOption::VALUE_NONE, 'Show only domain names')
->addOption('zone', null, InputOption::VALUE_NONE, 'Show zone assigned (with all zone versions)')
->addOption('active', null, InputOption::VALUE_NONE, 'Show the activated zones versions');
}
protected function execute(InputInterface $input, OutputInterface $output)

View File

@ -18,10 +18,12 @@ class DomainRemoveCommand extends AbstractCommand
$this
->setName('domain:remove')
->setDescription('Remove a domain')
->addOption('name', null, InputOption::VALUE_REQUIRED, '')
->addOption('id', null, InputOption::VALUE_REQUIRED, '')
->addOption('confirm', null, InputOption::VALUE_NONE, '')
->setHelp("The <info>%command.name%</info> ");
->addOption('name', null, InputOption::VALUE_REQUIRED, 'Domain name')
->addOption('id', null, InputOption::VALUE_REQUIRED, 'Domain ID')
->addOption('confirm', null, InputOption::VALUE_NONE, 'Confirmation')
->setHelp("<info>%command.name%</info>
You can use <info>--name</info> or <info>--id</info> to identify the domain to remove.");
}
protected function execute(InputInterface $input, OutputInterface $output)
@ -52,6 +54,8 @@ class DomainRemoveCommand extends AbstractCommand
$confirm = $this->getInput()->getOption('confirm');
if (false === $confirm) {
$this->getOutput()->writeln('<comment>By removing this domain, you will remove all associated records!</comment>');
$confirm = $this->getHelper('dialog')->askConfirmation($this->getOutput(), '<info>Do you confirm? [<comment>no</comment>] ', false);
}

View File

@ -18,9 +18,8 @@ class ZoneAddCommand extends AbstractCommand
$this
->setName('zone:add')
->setDescription('Add a zone')
->addOption('name', null, InputOption::VALUE_REQUIRED, '')
->addOption('description', null, InputOption::VALUE_REQUIRED, '')
->setHelp("The <info>%command.name%</info> ");
->addOption('name', null, InputOption::VALUE_REQUIRED, 'Zone name')
->addOption('description', null, InputOption::VALUE_REQUIRED, 'Zone description');
}
protected function execute(InputInterface $input, OutputInterface $output)

View File

@ -19,10 +19,9 @@ class ZoneAssignCommand extends AbstractCommand
$this
->setName('zone:assign')
->setDescription('Add a domain')
->addArgument('zone_id', InputArgument::REQUIRED, 'ZONE_ID')
->addArgument('domain_id', InputArgument::REQUIRED, 'DOMAIN_ID')
->setHelp("The <info>%command.name%</info> ");
->setDescription('Assign a zone to a domain.')
->addArgument('zone_id', InputArgument::REQUIRED, 'Zone ID')
->addArgument('domain_id', InputArgument::REQUIRED, 'Domain ID');
}
protected function execute(InputInterface $input, OutputInterface $output)

View File

@ -17,10 +17,9 @@ class ZoneListCommand extends AbstractZoneCommand
$this
->setName('zone:list')
->setDescription('List DNS zones')
->addOption('name', null, InputOption::VALUE_REQUIRED, '')
->addOption('id', null, InputOption::VALUE_REQUIRED, '')
->addOption('zversion', null, InputOption::VALUE_REQUIRED, '')
->setHelp("The <info>%command.name%</info> ");
->addOption('name', null, InputOption::VALUE_REQUIRED, 'Filter by zone name')
->addOption('id', null, InputOption::VALUE_REQUIRED, 'Filter by zone ID')
->addOption('vs', null, InputOption::VALUE_REQUIRED, 'Filter zone version');
}
protected function execute(InputInterface $input, OutputInterface $output)
@ -43,8 +42,8 @@ class ZoneListCommand extends AbstractZoneCommand
if ($this->getInput()->getOption('name')) {
$query->filterByName(sprintf('%%%s%%', $this->getInput()->getOption('name')));
}
if ($this->getInput()->getOption('id')) {
if ($this->getInput()->getOption('id')) {
$query->filterById((int) $this->getInput()->getOption('id'));
}

View File

@ -19,7 +19,11 @@ class ZonePushCommand extends AbstractZoneCommand
$this
->setName('zone:push')
->setDescription('Push activated zones to PowerDNS tables')
->setHelp("The <info>%command.name%</info> ");
->setHelp("<info>%command.name%</info>
After editing zone versions, you have to push all modifications by using <info>%command.name%</info>.
The PDNS records will be replaced with your activated zones versions.");
}
protected function execute(InputInterface $input, OutputInterface $output)

View File

@ -21,14 +21,18 @@ class ZoneRecordAddCommand extends AbstractCommand
$this
->setName('zone:record:add')
->setDescription('Add a zone record')
->addArgument('zone_id', InputArgument::REQUIRED, 'ZONE_ID')
->addArgument('version', InputArgument::REQUIRED, 'VERSION')
->addOption('name', null, InputOption::VALUE_REQUIRED, '')
->addOption('type', null, InputOption::VALUE_REQUIRED, '')
->addOption('content', null, InputOption::VALUE_REQUIRED, '')
->addOption('ttl', null, InputOption::VALUE_REQUIRED, '')
->addOption('prio', null, InputOption::VALUE_REQUIRED, '')
->setHelp("The <info>%command.name%</info> ");
->addArgument('zone_id', InputArgument::REQUIRED, 'Zone ID')
->addArgument('version', InputArgument::REQUIRED, 'Zone verion (only unactavated versions)')
->addOption('name', null, InputOption::VALUE_REQUIRED, 'Record name (eg: www)')
->addOption('type', null, InputOption::VALUE_REQUIRED, 'Record type (eg: A)')
->addOption('content', null, InputOption::VALUE_REQUIRED, 'Record content (eg: 1.2.3.4)')
->addOption('ttl', null, InputOption::VALUE_REQUIRED, 'Record TTL (eg: 3600)')
->addOption('prio', null, InputOption::VALUE_REQUIRED, 'Record priority (eg: 10)')
->setHelp("<info>%command.name%</info>
<info>--prio</info>
Use \"null\" to set NULL value
");
}
protected function execute(InputInterface $input, OutputInterface $output)

View File

@ -19,9 +19,8 @@ class ZoneRecordRemoveCommand extends AbstractCommand
$this
->setName('zone:record:remove')
->setDescription('Remove a zone record')
->addArgument('id', InputArgument::REQUIRED, 'ZONE_ID')
->addOption('confirm', null, InputOption::VALUE_NONE, '')
->setHelp("The <info>%command.name%</info> ");
->addArgument('id', InputArgument::REQUIRED, 'Record ID (the record can not be associated with an active zone version)')
->addOption('confirm', null, InputOption::VALUE_NONE, 'Confirmation');
}
protected function execute(InputInterface $input, OutputInterface $output)
@ -39,7 +38,7 @@ class ZoneRecordRemoveCommand extends AbstractCommand
}
if ($zoneRecord->getZoneVersion()->getIsActive()) {
$this->getOutput()->writeln('<error>You can not remove a zone record of an activated zone version.</error>');
$this->getOutput()->writeln('<error>You can not remove a record of an active zone version.</error>');
return;
}

View File

@ -18,9 +18,8 @@ class ZoneUnassignCommand extends AbstractCommand
$this
->setName('zone:unassign')
->setDescription('Add a domain')
->addArgument('domain_id', InputArgument::REQUIRED, 'ZONE_ID')
->setHelp("The <info>%command.name%</info> ");
->setDescription('Unassign the domain zone')
->addArgument('domain_id', InputArgument::REQUIRED, 'Domain ID');
}
protected function execute(InputInterface $input, OutputInterface $output)

View File

@ -18,9 +18,8 @@ class ZoneVersionActiveCommand extends AbstractCommand
$this
->setName('zone:version:active')
->setDescription('Active a zone version')
->addArgument('zone_id', InputArgument::REQUIRED, 'ZONE_ID')
->addArgument('version', InputArgument::REQUIRED, 'VERSION')
->setHelp("The <info>%command.name%</info> ");
->addArgument('zone_id', InputArgument::REQUIRED, 'Zone ID')
->addArgument('version', InputArgument::REQUIRED, 'Zone version');
}
protected function execute(InputInterface $input, OutputInterface $output)

View File

@ -21,8 +21,7 @@ class ZoneVersionAddCommand extends AbstractCommand
$this
->setName('zone:version:add')
->setDescription('Add a zone version')
->addArgument('zone_id', InputArgument::REQUIRED, 'ZONE_ID')
->setHelp("The <info>%command.name%</info> ");
->addArgument('zone_id', InputArgument::REQUIRED, 'Zone ID');
}
protected function execute(InputInterface $input, OutputInterface $output)

View File

@ -19,9 +19,8 @@ class ZoneVersionCopyCommand extends AbstractCommand
$this
->setName('zone:version:copy')
->setDescription('Copy a zone version')
->addArgument('zone_id', InputArgument::REQUIRED, 'ZONE_ID')
->addArgument('version', InputArgument::REQUIRED, 'VERSION')
->setHelp("The <info>%command.name%</info> ");
->addArgument('zone_id', InputArgument::REQUIRED, 'Zone ID')
->addArgument('version', InputArgument::REQUIRED, 'Zone version');
}
protected function execute(InputInterface $input, OutputInterface $output)

View File

@ -19,10 +19,9 @@ class ZoneVersionRemoveCommand extends AbstractCommand
$this
->setName('zone:version:remove')
->setDescription('Remove an unactivated zone version')
->addArgument('zone_id', InputArgument::REQUIRED, 'ZONE_ID')
->addArgument('version', InputArgument::REQUIRED, 'VERSION')
->addOption('confirm', null, InputOption::VALUE_NONE, '')
->setHelp("The <info>%command.name%</info> ");
->addArgument('zone_id', InputArgument::REQUIRED, 'Zone ID')
->addArgument('version', InputArgument::REQUIRED, 'Zone version')
->addOption('confirm', null, InputOption::VALUE_NONE, '');
}
protected function execute(InputInterface $input, OutputInterface $output)

View File

@ -17,10 +17,9 @@ class ZoneVersionUnactiveCommand extends AbstractCommand
$this
->setName('zone:version:unactive')
->setDescription('Unactive a zone version')
->addArgument('zone_id', InputArgument::REQUIRED, 'ZONE_ID')
->addArgument('version', InputArgument::REQUIRED, 'VERSION')
->setHelp("The <info>%command.name%</info> ");
->setDescription('Active a zone version')
->addArgument('zone_id', InputArgument::REQUIRED, 'Zone ID')
->addArgument('version', InputArgument::REQUIRED, 'Zone version');
}
protected function execute(InputInterface $input, OutputInterface $output)