From ad638e648bad574ad5f9e2f9b512cb9f44d42f5d Mon Sep 17 00:00:00 2001 From: Russ Long Date: Fri, 30 Mar 2018 13:07:30 -0400 Subject: [PATCH] Create Zone --- app/Http/Controllers/PagesController.php | 45 +++++++++++++----------- 1 file changed, 24 insertions(+), 21 deletions(-) diff --git a/app/Http/Controllers/PagesController.php b/app/Http/Controllers/PagesController.php index 72a7e88..d718b58 100644 --- a/app/Http/Controllers/PagesController.php +++ b/app/Http/Controllers/PagesController.php @@ -28,29 +28,32 @@ class PagesController extends Controller ]; $client = new Client(); //GuzzleHttp\Client $result = $client->post('http://127.0.0.1:8081/api/v1/servers/localhost/zones', [ - 'form_params' => [ - 'kind' => 'Native', - 'masters' => [], - 'name' => $zone_name, - 'nameservers' => [ - '0' => 'pdnstest.tfmm.co' - ], - 'records' => [ - '0' => [ - 'content' => 'pdnstest.tfmm.co. hostmaster.tfmm.co. 1 1800 900 604800 86400', - 'disabled' => 'false', - 'ttl' => '86400', - 'type' => 'SOA' - ], - '1' => [ - 'content' => $zone_primary_ip, - 'disabled' => 'false', + \GuzzleHttp\RequestOptions::JSON => [ + + 'form_params' => [ + 'kind' => 'Native', + 'masters' => [], 'name' => $zone_name, - 'ttl' => '3600', - 'type' => 'A' + 'nameservers' => [ + '0' => 'pdnstest.tfmm.co' + ], + 'records' => [ + '0' => [ + 'content' => 'pdnstest.tfmm.co. hostmaster.tfmm.co. 1 1800 900 604800 86400', + 'disabled' => 'false', + 'ttl' => '86400', + 'type' => 'SOA' + ], + '1' => [ + 'content' => $zone_primary_ip, + 'disabled' => 'false', + 'name' => $zone_name, + 'ttl' => '3600', + 'type' => 'A' + ] + ] ] - ] - ], + ], 'headers' => [ 'X-API-Key' => 'JgTtTq6EFVeo7X71wOVCYQk3rOie2G1k' ]