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

Add support for HAProxy Listens nodes_ids #127

Merged
merged 1 commit into from
Jan 20, 2025
Merged
Show file tree
Hide file tree
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
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 2 additions & 0 deletions src/Endpoints/HAProxyListens.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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',
Expand Down
16 changes: 16 additions & 0 deletions src/Models/HAProxyListen.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ class HAProxyListen extends ClusterModel

private string $nodesGroup;

private ?array $nodesIds = null;

private ?int $port = null;

private ?string $socketPath = null;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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'))
Expand All @@ -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(),
Expand Down
Loading