From e673437ab28df6735d776cf18cf7af69c917c265 Mon Sep 17 00:00:00 2001 From: Mohammad Niknab Date: Thu, 29 Feb 2024 12:53:03 +0000 Subject: [PATCH] add getByIdentifier to vps repository --- CHANGELOG.md | 4 ++++ src/Repository/VpsRepository.php | 11 ++++++++++- src/TransipAPI.php | 2 +- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6237905..89640a3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ CHANGELOG ========= +6.49.7 +--- +* Added the `getByIdentifier` function in the VPS repository + 6.49.6 --- * Add contact key endpoint diff --git a/src/Repository/VpsRepository.php b/src/Repository/VpsRepository.php index e29cc89..ce88f8b 100644 --- a/src/Repository/VpsRepository.php +++ b/src/Repository/VpsRepository.php @@ -46,7 +46,16 @@ public function getSelection(int $page, int $itemsPerPage): array public function getByName(string $name): Vps { - $response = $this->httpClient->get($this->getResourceUrl($name)); + return $this->getByIdentifier($name); + } + + /** + * @param string $identifier (vps name or vps uuid) + * @return Vps + */ + public function getByIdentifier(string $identifier): Vps + { + $response = $this->httpClient->get($this->getResourceUrl($identifier)); $vps = $this->getParameterFromResponse($response, 'vps'); return new Vps($vps); diff --git a/src/TransipAPI.php b/src/TransipAPI.php index dcb891b..847c208 100644 --- a/src/TransipAPI.php +++ b/src/TransipAPI.php @@ -101,7 +101,7 @@ class TransipAPI { public const TRANSIP_API_ENDPOINT = "https://api.transip.nl/v6"; - public const TRANSIP_API_LIBRARY_VERSION = "6.49.6"; + public const TRANSIP_API_LIBRARY_VERSION = "6.49.7"; public const TRANSIP_API_DEMO_TOKEN = "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6ImN3MiFSbDU2eDNoUnkjelM4YmdOIn0.eyJpc3MiOiJhcGkudHJhbnNpcC5ubCIsImF1ZCI6ImFwaS50cmFuc2lwLm5sIiwianRpIjoiY3cyIVJsNTZ4M2hSeSN6UzhiZ04iLCJpYXQiOjE1ODIyMDE1NTAsIm5iZiI6MTU4MjIwMTU1MCwiZXhwIjoyMTE4NzQ1NTUwLCJjaWQiOiI2MDQ0OSIsInJvIjpmYWxzZSwiZ2siOmZhbHNlLCJrdiI6dHJ1ZX0.fYBWV4O5WPXxGuWG-vcrFWqmRHBm9yp0PHiYh_oAWxWxCaZX2Rf6WJfc13AxEeZ67-lY0TA2kSaOCp0PggBb_MGj73t4cH8gdwDJzANVxkiPL1Saqiw2NgZ3IHASJnisUWNnZp8HnrhLLe5ficvb1D9WOUOItmFC2ZgfGObNhlL2y-AMNLT4X7oNgrNTGm-mespo0jD_qH9dK5_evSzS3K8o03gu6p19jxfsnIh8TIVRvNdluYC2wo4qDl5EW5BEZ8OSuJ121ncOT1oRpzXB0cVZ9e5_UVAEr9X3f26_Eomg52-PjrgcRJ_jPIUYbrlo06KjjX2h0fzMr21ZE023Gw"; /**