justim/neostrada-api-client

此包最新版本(0.1.0)没有提供许可信息。

Neostrada DNS/主机提供商的API客户端

0.1.0 2015-03-06 13:34 UTC

This package is auto-updated.

Last update: 2024-09-05 04:20:11 UTC


README

Neostrada DNS/主机提供商的API客户端

要求

  • PHP >= 5.4

安装

  • justim/neostrada-api-client添加到您的composer.json
  • composer install justim/neostrada-api-client

用法

$neostrada = new Neostrada($apiKey, $secret);

$domain = $neostrada->domain('example.com');

// set A-record for www to 127.0.0.1
$domain->a('www', '127.0.0.1');

// you can do the same for CNAME-records
$domain->cname('autodiscover', 'autodiscover.outlook.com');

// alternatively you can get an instance of a record and make your changes there
$a = $domain->a('www');
$a->content = '10.0.0.2';
$a->ttl = 1800;

// making changes to current records doesn't automatically save changes
$domain->save();

$mxRecords = $domain->mx(); // lists all MX-records

foreach ($mxRecords as $mx)
{
	// change the content of the record
	$mx->content = 'mail.google.com';

	// mark the records as deleted
	$mx->setDeleted();
}

$mxRecords->save();

// adding records can be done by a new record and adding it
$a = $domain->create('a');
$a->name = 'mail';
$a->content = '127.0.0.1';
$domain->add($a); // adding a record saves it immediately

// fetching the auth code
$authCode = $domain->authCode();

可能的API调用列表

  • getnameserver
  • getdns
  • dns
  • adddns
  • gettoken
  • 扩展
  • whois
  • holder
  • deleteholder
  • getholders
  • register
  • nameserver