Skip to content

Commit

Permalink
Merge pull request #2 from jmjmjm/master
Browse files Browse the repository at this point in the history
Changed Content Type from form to json in Server Model
  • Loading branch information
Lukas Kämmerling authored Feb 5, 2018
2 parents f22018e + ee0cabe commit fd58477
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/Models/Servers/Server.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
],
Expand Down Expand Up @@ -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,
],
Expand All @@ -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,
],
]);
Expand All @@ -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,
],
Expand All @@ -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,
],
]);
Expand Down Expand Up @@ -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,
],
]);
Expand Down Expand Up @@ -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,
],
Expand Down Expand Up @@ -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,
],
]);
Expand Down Expand Up @@ -483,4 +483,4 @@ public static function parse($input)
}
return (new self($input->id))->setAdditionalData($input);
}
}
}

0 comments on commit fd58477

Please sign in to comment.