Skip to content

Commit

Permalink
Merge pull request #25 from voxter/delete-node
Browse files Browse the repository at this point in the history
Add deleteNode method for the DELETE /REST/Node/<zone>/<FQDN>/ resource
  • Loading branch information
tfountain authored May 5, 2018
2 parents df0b923 + 0654887 commit 3e8e75c
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/TrafficManagement/Zone.php
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,28 @@ public function getDefaultTtl($defaultTtl)
return $this->defaultTtl;
}

/**
* Delete a node from the zone, including all of its records and any nodes
* underneath it
*
* @param string $fqdn FQDN of the node to delete
* @return boolean|ApiResponse
*/
public function deleteNode($fqdn) {
$path = '/Node/'.$this->getName().'/'.$fqdn.'/';

$result = $this->apiClient->delete($path);
if ($result && $result->isOk()) {
if ($result->isComplete()) {
return true;
} else {
return $result;
}
}

return false;
}

/**
* Create the supplied record
*
Expand Down

0 comments on commit 3e8e75c

Please sign in to comment.