Exemple #1
0
 /**
  * Add a secondary dns domain.
  * @param  array|string        $domain If domain is an array, add multiple domains. If it is a string, just add one domain.
  * @param  array               $config An array of configuration to apply to the domain or domains.
  * @return \DNSMadeEasy\Result
  */
 public function add($domain, array $config = array())
 {
     if (is_array($domain)) {
         $data = array('names' => $domain);
     } else {
         $data = array('names' => array($domain));
     }
     $data = array_merge($data, $config);
     return $this->_driver->post("/dns/secondary/", $data);
 }
Exemple #2
0
 /**
  * Add a record to a domain.
  * To insert multiple records at once, $config should be an array containing array of records.
  * @param  integer             $domainId The id of the domain.
  * @param  array               $config   The configuration for the record.
  * @return \DNSMadeEasy\Result
  */
 public function add($domainId, array $config)
 {
     $default = array('ttl' => 1800, 'gtdLocation' => 'DEFAULT');
     if (is_array(reset($config))) {
         foreach ($config as &$record) {
             $record = array_merge($default, $record);
         }
         return $this->_driver->post("/dns/managed/{$domainId}/records/createMulti", $config);
     } else {
         $config = array_merge($default, $config);
         return $this->_driver->post("/dns/managed/{$domainId}/records", $config);
     }
 }
Exemple #3
0
 /**
  * @covers DNSMadeEasy\driver\REST::post
  * @covers DNSMadeEasy\driver\REST::put
  * @covers DNSMadeEasy\driver\REST::delete
  */
 public function testPostPutAndDelete()
 {
     $config = array('name' => 'PHPLibraryTest', 'email' => 'php.library.com', 'ttl' => 86400, 'comp' => 'ns.phplibrarytest.com', 'serial' => 2012020203, 'refresh' => 14400, 'retry' => 1800, 'expire' => 86400, 'negativeCache' => 1800);
     //POST
     $result = $this->rest->post('/dns/soa', $config);
     $this->assertTrue($result->success, "Creating the SoA was unsuccessful");
     $this->assertInstanceOf('DNSMadeEasy\\Result', $result, 'The result should be of the type DNSMadeEasy\\Result');
     $this->assertEquals('PHPLibraryTest', $result->body->name, "The created SoA does not match");
     $id = $result->body->id;
     //PUT
     $config['email'] = 'php2.library.com';
     $result = $this->rest->put("/dns/soa/{$id}", $config);
     $this->assertTrue($result->success, "Updating the SoA was unsuccessful");
     //DELETE
     $result = $this->rest->delete("/dns/soa/{$id}");
     $this->assertTrue($result->success, "Deleting the SoA was unsuccessful");
 }
 /**
  * Add a secondary dns record to a secondary dns domain.
  * @param  integer             $domainId The id of the domain.
  * @param  array               $config   The configuration for the record.
  * @return \DNSMadeEasy\Result
  */
 public function add($domainId, array $config)
 {
     return $this->_driver->post("/dns/secondary/{$domainId}/records", $config);
 }
Exemple #5
0
 /**
  * Create an ip set.
  * @param array $config The configuration of the ip set.
  */
 public function add(array $config)
 {
     return $this->_driver->post("/dns/secondary/ipSet", $config);
 }
Exemple #6
0
 /**
  * Create a SoA record.
  * @param  array               $config The configuration of the new SoA record.
  * @return \DNSMadeEasy\Result
  */
 public function add(array $config)
 {
     $default = array('ttl' => 86400, 'serial' => 2012020201, 'refresh' => 14400, 'retry' => 1800, 'expire' => 86400, 'negativeCache' => 1800);
     $config = array_merge($default, $config);
     return $this->_driver->post("/dns/soa", $config);
 }
 /**
  * Add a record to a template.
  * @param  integer             $templateId The id of the template.
  * @param  array               $config     The configuration of the new record.
  * @return \DNSMadeEasy\Result
  */
 public function add($templateId, array $config)
 {
     return $this->_driver->post("/dns/template/{$templateId}/records", $config);
 }
Exemple #8
0
 /**
  * Create a new template.
  * @param  array               $config Configuraton for the template.
  * @return \DNSMadeEasy\Result
  */
 public function add(array $config)
 {
     return $this->_driver->post("/dns/template", $config);
 }
Exemple #9
0
 /**
  * Create a folder.
  * @param  array               $config The configuration of the folder.
  * @return \DNSMadeEasy\Result
  */
 public function add(array $config)
 {
     return $this->_driver->post("/security/folder", $config);
 }
Exemple #10
0
 /**
  * Create a new transfer ACL.
  * @param  array               $config The configuration of the new transfer ACL.
  * @return \DNSMadeEasy\Result
  */
 public function add(array $config)
 {
     return $this->_driver->post("/dns/transferAcl", $config);
 }
Exemple #11
0
 /**
  * Add a vanity DNS configuration.
  * @param  array               $config The configuration for the vanity DNS configuration.
  * @return \DNSMadeEasy\Result
  */
 public function add(array $config)
 {
     return $this->_driver->post("/dns/vanity", $config);
 }