diff --git a/README.md b/README.md index a048319..2d25942 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # BunnyCDN API Class The most comprehensive, feature packed and easy to use PHP class for the BunnyCDN pull and storage zones [API](https://bunnycdn.docs.apiary.io/). -This class whilst having a main focus on storage zone interaction includes pull zone features. +This class whilst having a main focus on storage zone interaction includes pull zone features. Combining API with FTP, managing and using BunnyCDN storage zones just got easier. @@ -46,7 +46,9 @@ If you want to interact with storage zones you will need your BunnyCDN API key s * View monthly charge breakdown * Apply coupon code * List pull zones +* Get pull zone * Add pull zone +* Update pull zone * Delete pull zone * Purge pull zone * Add hostname to pull zone @@ -553,4 +555,4 @@ $bunny->insertPullZoneLogs($id, $date); ## TODO * Proper exception handling -* Improve action logging \ No newline at end of file +* Improve action logging diff --git a/src/BunnyAPI.php b/src/BunnyAPI.php index f3d4122..304d22b 100644 --- a/src/BunnyAPI.php +++ b/src/BunnyAPI.php @@ -179,6 +179,16 @@ public function listPullZones() return $this->APIcall('GET', 'pullzone'); } + /** + * Gets a single pull zone information + * @param int $id + * @return string + */ + public function getPullZone(int $id) + { + return $this->APIcall('GET', "pullzone/$id"); + } + /** * Creates pull zone * @param string $name @@ -198,6 +208,17 @@ public function createPullZone(string $name, string $origin, array $args = array return $this->APIcall('POST', 'pullzone', json_encode($args)); } + /** + * Updates pull zone + * @param int $id + * @param array $args + * @return string + */ + public function updatePullZone(int $id, array $args = array()) + { + return $this->APIcall('POST', "pullzone/$id", json_encode($args)); + } + /** * Returns pull zone information for id * @param int $id @@ -1223,4 +1244,4 @@ public function costCalculator(int $bytes): array ); } -} \ No newline at end of file +}