Skip to content

Commit 3e8e75c

Browse files
authored
Merge pull request #25 from voxter/delete-node
Add deleteNode method for the DELETE /REST/Node/<zone>/<FQDN>/ resource
2 parents df0b923 + 0654887 commit 3e8e75c

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

src/TrafficManagement/Zone.php

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,28 @@ public function getDefaultTtl($defaultTtl)
215215
return $this->defaultTtl;
216216
}
217217

218+
/**
219+
* Delete a node from the zone, including all of its records and any nodes
220+
* underneath it
221+
*
222+
* @param string $fqdn FQDN of the node to delete
223+
* @return boolean|ApiResponse
224+
*/
225+
public function deleteNode($fqdn) {
226+
$path = '/Node/'.$this->getName().'/'.$fqdn.'/';
227+
228+
$result = $this->apiClient->delete($path);
229+
if ($result && $result->isOk()) {
230+
if ($result->isComplete()) {
231+
return true;
232+
} else {
233+
return $result;
234+
}
235+
}
236+
237+
return false;
238+
}
239+
218240
/**
219241
* Create the supplied record
220242
*

0 commit comments

Comments
 (0)