Skip to content

Commit

Permalink
Merge pull request #19 from nexcess/master
Browse files Browse the repository at this point in the history
Adding in /ZoneFile support
  • Loading branch information
tfountain authored May 18, 2017
2 parents 3874984 + 6b986ad commit c2d0fc2
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions src/TrafficManagement.php
Original file line number Diff line number Diff line change
Expand Up @@ -268,4 +268,31 @@ public function deleteZone($zone)

return false;
}

/**
* Create the specified zone given the data file
* @see https://help.dyn.com/upload-zone-file-api/
*
* @param string $zoneName
* @param string $contents
* @return boolean|Dyn\TrafficManagement\Api\Response
*/
public function createZoneFromFile($zoneName, $contents)
{
$params = array(
'file' => $contents
);

$result = $this->apiClient->post('/ZoneFile/'.$zoneName, $params);

if ($result && $result->isOk()) {
if ($result->isComplete()) {
return true;
} else {
return $result;
}
}

return false;
}
}

0 comments on commit c2d0fc2

Please sign in to comment.