-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'dnszone' into 'master'
added getZonefile in tipctl See merge request transip/restapi-cli-client!126
- Loading branch information
Showing
5 changed files
with
46 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,9 @@ | ||
CHANGELOG | ||
========= | ||
|
||
6.7.1 | ||
----- | ||
* Added getZoneFile function | ||
|
||
6.7.0 | ||
----- | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?php | ||
|
||
namespace Transip\Api\CLI\Command\Domain\Dns; | ||
|
||
use Symfony\Component\Console\Input\InputArgument; | ||
use Symfony\Component\Console\Input\InputInterface; | ||
use Symfony\Component\Console\Output\OutputInterface; | ||
use Symfony\Component\Console\Helper\Table; | ||
use Transip\Api\CLI\Command\AbstractCommand; | ||
use Transip\Api\CLI\Command\Field; | ||
use Transip\Api\Library\Entity\Domain\DnsEntry; | ||
|
||
class GetZoneFile extends AbstractCommand | ||
{ | ||
protected function configure(): void | ||
{ | ||
$this->setName('domain:dns:getzonefile') | ||
->setDescription('Get DNS zonefile for a domain') | ||
->setHelp('Provide a name to retrieve the DNS Records for a specific domain') | ||
->addArgument(Field::DOMAIN_NAME, InputArgument::REQUIRED, Field::DOMAIN_NAME__DESC); | ||
} | ||
|
||
protected function execute(InputInterface $input, OutputInterface $output) | ||
{ | ||
$domainName = $input->getArgument(Field::DOMAIN_NAME); | ||
$dnsEntries = $this->getTransipApi()->domainDns()->getByDomainName($domainName); | ||
$table = new Table($output); | ||
$table->setStyle('compact'); | ||
$table->setRows(array_map(function (DnsEntry $row) { | ||
return [$row->getName(), $row->getType(), $row->getExpire(), $row->getRdata()]; | ||
}, $dnsEntries)); | ||
$table->render(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters