diff --git a/src/Models/Servers/Server.php b/src/Models/Servers/Server.php index d26a939..582689b 100644 --- a/src/Models/Servers/Server.php +++ b/src/Models/Servers/Server.php @@ -231,7 +231,7 @@ public function resetRootPassword(): Action public function enableRescue($type = 'linux64', $ssh_keys = []): Action { $response = $this->httpClient->post($this->replaceServerIdInUri('servers/{id}/actions/enable_rescue'), [ - 'form_params' => [ + 'json' => [ 'type' => $type, 'ssh_keys' => $ssh_keys, ], @@ -269,7 +269,7 @@ public function createImage(string $description = '', string $type = 'snapshot') { $response = $this->httpClient->post($this->replaceServerIdInUri('servers/{id}/actions/create_image'), [ - 'form_params' => [ + 'json' => [ 'description' => $description, 'type' => $type, ], @@ -290,7 +290,7 @@ public function createImage(string $description = '', string $type = 'snapshot') public function rebuildFromImage(Image $image): Action { $response = $this->httpClient->post($this->replaceServerIdInUri('servers/{id}/actions/rebuild'), [ - 'form_params' => [ + 'json' => [ 'image' => $image->id, ], ]); @@ -311,7 +311,7 @@ public function rebuildFromImage(Image $image): Action public function changeType(ServerType $serverType, bool $upgradeDisk = false): Action { $response = $this->httpClient->post($this->replaceServerIdInUri('servers/{id}/actions/change_type'), [ - 'form_params' => [ + 'json' => [ 'server_type' => $serverType->id, 'upgrade_disk' => $upgradeDisk, ], @@ -332,7 +332,7 @@ public function changeType(ServerType $serverType, bool $upgradeDisk = false): A public function enableBackups(string $backupWindow = null): Action { $response = $this->httpClient->post($this->replaceServerIdInUri('servers/{id}/actions/enable_backup'), [ - 'form_params' => [ + 'json' => [ 'backup_window' => $backupWindow, ], ]); @@ -367,7 +367,7 @@ public function disableBackups(): Action public function attachISO(ISO $iso): Action { $response = $this->httpClient->post($this->replaceServerIdInUri('servers/{id}/actions/attach_iso'), [ - 'form_params' => [ + 'json' => [ 'iso' => $iso->id, ], ]); @@ -403,7 +403,7 @@ public function detachISO(): Action public function changeReverseDNS(string $ip, string $dnsPtr): Action { $response = $this->httpClient->post($this->replaceServerIdInUri('servers/{id}/actions/change_dns_ptr'), [ - 'form_params' => [ + 'json' => [ 'ip' => $ip, 'dns_ptr' => $dnsPtr, ], @@ -454,7 +454,7 @@ public function delete(): Action public function changeName(string $name): Server { $response = $this->httpClient->put($this->replaceServerIdInUri('servers/{id}'), [ - 'form_params' => [ + 'json' => [ 'name' => $name, ], ]); @@ -483,4 +483,4 @@ public static function parse($input) } return (new self($input->id))->setAdditionalData($input); } -} \ No newline at end of file +}