From 576a1c37d07f4db6b2fad5bbd0b57db9367e3880 Mon Sep 17 00:00:00 2001 From: Ranjani Renganathan Date: Mon, 27 Nov 2017 15:48:31 -0800 Subject: [PATCH 1/2] updated '/consumers/' to 'consumers/' updated '/consumers/' to 'consumers' .This makes it more flexible to use the loop back for kong admin uri --- Kong/Services/Consumer.php | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/Kong/Services/Consumer.php b/Kong/Services/Consumer.php index 342eedc..3efa2e4 100644 --- a/Kong/Services/Consumer.php +++ b/Kong/Services/Consumer.php @@ -22,76 +22,76 @@ public function __construct(Client $client = null) public function create($body = []) { - return $this->client->post('/consumers/', ['body' => $body]); + return $this->client->post('consumers/', ['body' => $body]); } public function retrieve($consumer) { - return $this->client->get('/consumers/'.$consumer); + return $this->client->get('consumers/'.$consumer); } public function all($body = []) { - return $this->client->get('/consumers/', ['body' => $body]); + return $this->client->get('consumers/', ['body' => $body]); } public function update($consumer, $body = []) { - return $this->client->patch('/consumers/'.$consumer, ['body' => $body]); + return $this->client->patch('consumers/'.$consumer, ['body' => $body]); } public function updateOrCreate($body = []) { - return $this->client->put('/consumers/', ['body' => $body]); + return $this->client->put('consumers/', ['body' => $body]); } public function delete($consumer) { - return $this->client->delete('/consumers/'.$consumer); + return $this->client->delete('consumers/'.$consumer); } public function allCredentials($consumer, $credential, $body = []) { - return $this->client->get('/consumers/'.$consumer.'/'.$credential, ['body' => $body]); + return $this->client->get('consumers/'.$consumer.'/'.$credential, ['body' => $body]); } public function createCredential($consumer, $credential, $body = []) { - return $this->client->post('/consumers/'.$consumer.'/'.$credential, ['body' => $body]); + return $this->client->post('consumers/'.$consumer.'/'.$credential, ['body' => $body]); } public function deleteCredential($consumer, $credential, $id) { - return $this->client->delete('/consumers/'.$consumer.'/'.$credential.'/'.$id); + return $this->client->delete('consumers/'.$consumer.'/'.$credential.'/'.$id); } public function allPlugins($consumer, $body = []) { - return $this->client->get('/consumers/'.$consumer.'/plugins', ['body' => $body]); + return $this->client->get('consumers/'.$consumer.'/plugins', ['body' => $body]); } public function createPlugin($consumer, $body = []) { - return $this->client->post('/consumers/'.$consumer.'/plugins', ['body' => $body]); + return $this->client->post('consumers/'.$consumer.'/plugins', ['body' => $body]); } public function deletePlugin($consumer, $id) { - return $this->client->delete('/consumers/'.$consumer.'/plugins/'.$id); + return $this->client->delete('consumers/'.$consumer.'/plugins/'.$id); } public function allAcls($consumer, $body = []) { - return $this->client->get('/consumers/'.$consumer.'/acls', ['body' => $body]); + return $this->client->get('consumers/'.$consumer.'/acls', ['body' => $body]); } public function createAcl($consumer, $body = []) { - return $this->client->post('/consumers/'.$consumer.'/acls', ['body' => $body]); + return $this->client->post('consumers/'.$consumer.'/acls', ['body' => $body]); } public function deleteAcl($consumer, $id) { - return $this->client->delete('/consumers/'.$consumer.'/acls/'.$id); + return $this->client->delete('consumers/'.$consumer.'/acls/'.$id); } } From af753ccbd2120fea53ea0838a8e59925a2e1e36e Mon Sep 17 00:00:00 2001 From: Ranjani Renganathan Date: Mon, 27 Nov 2017 16:31:42 -0800 Subject: [PATCH 2/2] limiting the change --- Kong/Services/Consumer.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Kong/Services/Consumer.php b/Kong/Services/Consumer.php index 3efa2e4..17e673f 100644 --- a/Kong/Services/Consumer.php +++ b/Kong/Services/Consumer.php @@ -67,31 +67,31 @@ public function deleteCredential($consumer, $credential, $id) public function allPlugins($consumer, $body = []) { - return $this->client->get('consumers/'.$consumer.'/plugins', ['body' => $body]); + return $this->client->get('/consumers/'.$consumer.'/plugins', ['body' => $body]); } public function createPlugin($consumer, $body = []) { - return $this->client->post('consumers/'.$consumer.'/plugins', ['body' => $body]); + return $this->client->post('/consumers/'.$consumer.'/plugins', ['body' => $body]); } public function deletePlugin($consumer, $id) { - return $this->client->delete('consumers/'.$consumer.'/plugins/'.$id); + return $this->client->delete('/consumers/'.$consumer.'/plugins/'.$id); } public function allAcls($consumer, $body = []) { - return $this->client->get('consumers/'.$consumer.'/acls', ['body' => $body]); + return $this->client->get('/consumers/'.$consumer.'/acls', ['body' => $body]); } public function createAcl($consumer, $body = []) { - return $this->client->post('consumers/'.$consumer.'/acls', ['body' => $body]); + return $this->client->post('/consumers/'.$consumer.'/acls', ['body' => $body]); } public function deleteAcl($consumer, $id) { - return $this->client->delete('consumers/'.$consumer.'/acls/'.$id); + return $this->client->delete('/consumers/'.$consumer.'/acls/'.$id); } }