Skip to content

Commit

Permalink
Merge branch 'dnszone' into 'master'
Browse files Browse the repository at this point in the history
added getZonefile in tipctl

See merge request transip/restapi-cli-client!126
  • Loading branch information
tgooren committed May 14, 2021
2 parents e1728bb + 1499e22 commit 839519f
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 9 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
CHANGELOG
=========

6.7.1
-----
* Added getZoneFile function

6.7.0
-----
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"symfony/console": "^4.3",
"symfony/finder": "^4.3",
"symfony/filesystem": "^4.3",
"transip/transip-api-php": "^6.7",
"transip/transip-api-php": "^6.7.1",
"symfony/yaml": "^4.3",
"webmozart/path-util": "^2.3"
},
Expand Down
14 changes: 7 additions & 7 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

34 changes: 34 additions & 0 deletions src/Command/Domain/Dns/GetZoneFile.php
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();
}
}
2 changes: 1 addition & 1 deletion src/Settings/Settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class Settings
private const CONFIG_FILE_NAME = 'cli-config.json';

public const TRANSIP_API_ENDPOINT = 'https://api.transip.nl/v6';
public const TRANSIP_CLI_VERSION = '6.7.0';
public const TRANSIP_CLI_VERSION = '6.7.1';

/**
* @var string
Expand Down

0 comments on commit 839519f

Please sign in to comment.