Skip to content

Commit

Permalink
Merge pull request #1 from clwells/master
Browse files Browse the repository at this point in the history
Adding in ZoneFile endpoint
  • Loading branch information
clwells authored May 16, 2017
2 parents 3874984 + 4c364f1 commit 6b986ad
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 6b986ad

Please sign in to comment.