From 9148ea1114ed7fa4ea9f7515cd342b10083f38cc Mon Sep 17 00:00:00 2001 From: Andrew Minion Date: Tue, 8 Dec 2020 20:53:46 -0600 Subject: [PATCH 1/4] add updatePullZone method --- src/BunnyAPI.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/BunnyAPI.php b/src/BunnyAPI.php index f3d4122..4c1cc5f 100644 --- a/src/BunnyAPI.php +++ b/src/BunnyAPI.php @@ -198,6 +198,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 +1234,4 @@ public function costCalculator(int $bytes): array ); } -} \ No newline at end of file +} From 9528dde554db58dc16d5526131707b493de4b99f Mon Sep 17 00:00:00 2001 From: Andrew Minion Date: Tue, 8 Dec 2020 20:54:33 -0600 Subject: [PATCH 2/4] update docs --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index a048319..fd74ced 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. @@ -47,6 +47,7 @@ If you want to interact with storage zones you will need your BunnyCDN API key s * Apply coupon code * List pull zones * Add pull zone +* Update pull zone * Delete pull zone * Purge pull zone * Add hostname to pull zone @@ -553,4 +554,4 @@ $bunny->insertPullZoneLogs($id, $date); ## TODO * Proper exception handling -* Improve action logging \ No newline at end of file +* Improve action logging From 6b9b9f2a10b43d205c8baebb06b51d7ebc4f5fa9 Mon Sep 17 00:00:00 2001 From: Andrew Minion Date: Tue, 8 Dec 2020 20:59:10 -0600 Subject: [PATCH 3/4] get a single pull zone --- README.md | 1 + src/BunnyAPI.php | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/README.md b/README.md index fd74ced..2d25942 100644 --- a/README.md +++ b/README.md @@ -46,6 +46,7 @@ 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 diff --git a/src/BunnyAPI.php b/src/BunnyAPI.php index 4c1cc5f..75e5799 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 getPullZones(int $id) + { + return $this->APIcall('GET', "pullzone/$id"); + } + /** * Creates pull zone * @param string $name From 0fcf0d42af82cb43ed35319f0cb8e788221f61ac Mon Sep 17 00:00:00 2001 From: Andrew Minion Date: Tue, 8 Dec 2020 21:06:26 -0600 Subject: [PATCH 4/4] fix method name --- src/BunnyAPI.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/BunnyAPI.php b/src/BunnyAPI.php index 75e5799..304d22b 100644 --- a/src/BunnyAPI.php +++ b/src/BunnyAPI.php @@ -184,7 +184,7 @@ public function listPullZones() * @param int $id * @return string */ - public function getPullZones(int $id) + public function getPullZone(int $id) { return $this->APIcall('GET', "pullzone/$id"); }