Skip to content

Commit 74da1f6

Browse files
authored
Merge pull request #77 from CyberfusionIO/bugfix/1.102.3
Add hostname field back to the update endpoint
2 parents d06a3d6 + a8b46f3 commit 74da1f6

File tree

4 files changed

+24
-2
lines changed

4 files changed

+24
-2
lines changed

CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
66
this package and not the cluster API. See the changelog of the [cluster API](https://cluster-api.cyberfusion.nl/redoc#section/Changelog)
77
for detailed information.
88

9+
## [1.102.3]
10+
11+
### Added
12+
13+
- Node: Add `hostname` field back to the update endpoint.
14+
915
## [1.102.2]
1016

1117
### Added

src/Client.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class Client implements ClientContract
1717
{
1818
private const CONNECT_TIMEOUT = 60;
1919
private const TIMEOUT = 180;
20-
private const VERSION = '1.102.2';
20+
private const VERSION = '1.102.3';
2121
private const USER_AGENT = 'cyberfusion-cluster-api-client/' . self::VERSION;
2222
private GuzzleClient $httpClient;
2323

src/Endpoints/Nodes.php

+2
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ public function update(Node $node): Response
109109
'groups_properties',
110110
'cluster_id',
111111
'id',
112+
'hostname',
112113
]);
113114

114115
$request = (new Request())
@@ -122,6 +123,7 @@ public function update(Node $node): Response
122123
'groups_properties',
123124
'cluster_id',
124125
'id',
126+
'hostname',
125127
])
126128
);
127129

src/Models/Node.php

+15-1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ class Node extends ClusterModel
1616
private ?int $clusterId = null;
1717
private ?string $createdAt = null;
1818
private ?string $updatedAt = null;
19+
private ?string $hostname = null;
1920

2021
public function getGroups(): ?array
2122
{
@@ -124,6 +125,17 @@ public function setUpdatedAt(?string $updatedAt): self
124125
return $this;
125126
}
126127

128+
public function getHostname(): ?string
129+
{
130+
return $this->hostname;
131+
}
132+
133+
public function setHostname(?string $hostname): self
134+
{
135+
$this->hostname = $hostname;
136+
return $this;
137+
}
138+
127139
public function fromArray(array $data): self
128140
{
129141
return $this
@@ -134,7 +146,8 @@ public function fromArray(array $data): self
134146
->setId(Arr::get($data, 'id'))
135147
->setClusterId(Arr::get($data, 'cluster_id'))
136148
->setCreatedAt(Arr::get($data, 'created_at'))
137-
->setUpdatedAt(Arr::get($data, 'updated_at'));
149+
->setUpdatedAt(Arr::get($data, 'updated_at'))
150+
->setHostname(Arr::get($data, 'hostname'));
138151
}
139152

140153
public function toArray(): array
@@ -148,6 +161,7 @@ public function toArray(): array
148161
'cluster_id' => $this->getClusterId(),
149162
'created_at' => $this->getCreatedAt(),
150163
'updated_at' => $this->getUpdatedAt(),
164+
'hostname' => $this->getHostname(),
151165
];
152166
}
153167
}

0 commit comments

Comments
 (0)