Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changed Content Type from form to json in Server Model #2

Merged
merged 1 commit into from
Feb 5, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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);
}
}
}