From 7c3e6e6ff1e320f32e7f2fc68cdcb53c9b06639d Mon Sep 17 00:00:00 2001 From: Mika Scheer Date: Tue, 24 Dec 2024 15:57:08 +0100 Subject: [PATCH] Add support for HAProxy Listens `nodes_ids` --- CHANGELOG.md | 6 ++++++ README.md | 2 +- src/Client.php | 2 +- src/Endpoints/HAProxyListens.php | 2 ++ src/Models/HAProxyListen.php | 16 ++++++++++++++++ 5 files changed, 26 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 81298979..4e566113 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). this package and not the Core API. See the changelog of the [Core API](https://core-api.cyberfusion.io/redoc#section/Changelog) for detailed information. +## [1.117.0] + +### Added + +- `nodes_ids` to HAProxy listens + ## [1.116.1] ### Fixed diff --git a/README.md b/README.md index e5a78047..4dd3a1cd 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ Client for the [Cyberfusion Core API](https://core-api.cyberfusion.io/). -This client was built for and tested on the **1.230.1** version of the API. +This client was built for and tested on the **1.238.0** version of the API. ## Support diff --git a/src/Client.php b/src/Client.php index 7ef4af14..17424c79 100644 --- a/src/Client.php +++ b/src/Client.php @@ -20,7 +20,7 @@ class Client implements ClientContract private const TIMEOUT = 180; - private const VERSION = '1.116.1'; + private const VERSION = '1.117.0'; private const USER_AGENT = 'cyberfusion-cluster-api-client/' . self::VERSION; diff --git a/src/Endpoints/HAProxyListens.php b/src/Endpoints/HAProxyListens.php index 373ece46..4bcf1a0a 100644 --- a/src/Endpoints/HAProxyListens.php +++ b/src/Endpoints/HAProxyListens.php @@ -67,6 +67,7 @@ public function create(HAProxyListen $haProxyListen): Response $this->validateRequired($haProxyListen, 'create', [ 'name', 'nodes_group', + 'nodes_ids', 'port', 'socket_path', 'destination_cluster_id', @@ -80,6 +81,7 @@ public function create(HAProxyListen $haProxyListen): Response $this->filterFields($haProxyListen->toArray(), [ 'name', 'nodes_group', + 'nodes_ids', 'port', 'socket_path', 'destination_cluster_id', diff --git a/src/Models/HAProxyListen.php b/src/Models/HAProxyListen.php index 395f0f82..64d91670 100644 --- a/src/Models/HAProxyListen.php +++ b/src/Models/HAProxyListen.php @@ -13,6 +13,8 @@ class HAProxyListen extends ClusterModel private string $nodesGroup; + private ?array $nodesIds = null; + private ?int $port = null; private ?string $socketPath = null; @@ -61,6 +63,18 @@ public function setNodesGroup(string $nodesGroup): self return $this; } + public function getNodesIds(): ?array + { + return $this->nodesIds; + } + + public function setNodesIds(?array $nodesIds): self + { + $this->nodesIds = $nodesIds; + + return $this; + } + public function getPort(): ?int { return $this->port; @@ -162,6 +176,7 @@ public function fromArray(array $data): self return $this ->setName(Arr::get($data, 'name')) ->setNodesGroup(Arr::get($data, 'nodes_group')) + ->setNodesIds(Arr::get($data, 'nodes_ids')) ->setPort(Arr::get($data, 'port')) ->setSocketPath(Arr::get($data, 'socket_path')) ->setDestinationClusterId(Arr::get($data, 'destination_cluster_id')) @@ -176,6 +191,7 @@ public function toArray(): array return [ 'name' => $this->getName(), 'nodes_group' => $this->getNodesGroup(), + 'nodes_ids' => $this->getNodesIds(), 'port' => $this->getPort(), 'socket_path' => $this->getSocketPath(), 'destination_cluster_id' => $this->getDestinationClusterId(),