Skip to content

Commit

Permalink
Merge branch 'order-vps-with-specified-license' into 'master'
Browse files Browse the repository at this point in the history
Added licenses parameter to vps orders

See merge request transip/restapi-php-library!164
  • Loading branch information
samihsoylu committed Jan 19, 2022
2 parents 28c150b + 93d43f0 commit 66a7524
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
CHANGELOG
=========

6.14.0
-----
* Added licenses parameter to vps order resource

6.13.0
-----
* You can now provide a license to override the default license of a preinstallable operating system when invoking a reinstall
Expand Down
9 changes: 7 additions & 2 deletions src/Repository/VpsRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ public function getByTagNames(array $tags): array
* @param string $installFlavour
* @param string $username
* @param string[] $sshKeys
* @param string[] $licenses
*/
public function order(
string $productName,
Expand All @@ -88,7 +89,8 @@ public function order(
string $base64InstallText = '',
string $installFlavour = '',
string $username = '',
array $sshKeys = []
array $sshKeys = [],
array $licenses = []
): void {
$parameters['productName'] = $productName;
$parameters['operatingSystem'] = $operatingSystemName;
Expand All @@ -114,9 +116,12 @@ public function order(
if ($username !== '') {
$parameters['username'] = $username;
}
if ($sshKeys !== '') {
if ($sshKeys !== []) {
$parameters['sshKeys'] = $sshKeys;
}
if ($licenses !== []) {
$parameters['licenses'] = $licenses;
}

$this->httpClient->post($this->getResourceUrl(), $parameters);
}
Expand Down
2 changes: 1 addition & 1 deletion src/TransipAPI.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
class TransipAPI
{
public const TRANSIP_API_ENDPOINT = "https://api.transip.nl/v6";
public const TRANSIP_API_LIBRARY_VERSION = "6.13.0";
public const TRANSIP_API_LIBRARY_VERSION = "6.14.0";
public const TRANSIP_API_DEMO_TOKEN = "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6ImN3MiFSbDU2eDNoUnkjelM4YmdOIn0.eyJpc3MiOiJhcGkudHJhbnNpcC5ubCIsImF1ZCI6ImFwaS50cmFuc2lwLm5sIiwianRpIjoiY3cyIVJsNTZ4M2hSeSN6UzhiZ04iLCJpYXQiOjE1ODIyMDE1NTAsIm5iZiI6MTU4MjIwMTU1MCwiZXhwIjoyMTE4NzQ1NTUwLCJjaWQiOiI2MDQ0OSIsInJvIjpmYWxzZSwiZ2siOmZhbHNlLCJrdiI6dHJ1ZX0.fYBWV4O5WPXxGuWG-vcrFWqmRHBm9yp0PHiYh_oAWxWxCaZX2Rf6WJfc13AxEeZ67-lY0TA2kSaOCp0PggBb_MGj73t4cH8gdwDJzANVxkiPL1Saqiw2NgZ3IHASJnisUWNnZp8HnrhLLe5ficvb1D9WOUOItmFC2ZgfGObNhlL2y-AMNLT4X7oNgrNTGm-mespo0jD_qH9dK5_evSzS3K8o03gu6p19jxfsnIh8TIVRvNdluYC2wo4qDl5EW5BEZ8OSuJ121ncOT1oRpzXB0cVZ9e5_UVAEr9X3f26_Eomg52-PjrgcRJ_jPIUYbrlo06KjjX2h0fzMr21ZE023Gw";

/**
Expand Down

0 comments on commit 66a7524

Please sign in to comment.