Skip to content

Commit

Permalink
Merge pull request #518 from ecloud-jay2/EC-1218
Browse files Browse the repository at this point in the history
added encrypt/decrypt
  • Loading branch information
ecloud-jay2 authored May 16, 2023
2 parents cc759f9 + 05fcad7 commit 13e03e8
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/eCloud/InstanceClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -238,4 +238,26 @@ public function getConsoleSession($id)

return $this->decodeJson($response->getBody()->getContents())->data;
}

public function encrypt($id)
{
$response = $this->put($this->collectionPath . '/' . $id . '/encrypt');

if ($response->getStatusCode() != 202) {
throw new UKFastException('unexpected response code: ' . $response->getStatusCode());
}

return $this->decodeJson($response->getBody()->getContents())->data;
}

public function decrypt($id)
{
$response = $this->put($this->collectionPath . '/' . $id . '/decrypt');

if ($response->getStatusCode() != 202) {
throw new UKFastException('unexpected response code: ' . $response->getStatusCode());
}

return $this->decodeJson($response->getBody()->getContents())->data;
}
}

0 comments on commit 13e03e8

Please sign in to comment.