Skip to content

Commit 6417adb

Browse files
authored
Fix sample
1 parent 8e0dabc commit 6417adb

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

examples/servers/create_a_server.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,16 @@
88
$apiResponse = $hetznerClient->servers()->createInLocation('my-example-server.test', $serverType, $image, $location);
99
$server = $apiResponse->getResponsePart('server');
1010
$action = $apiResponse->getResponsePart('action');
11+
$next_actions = $apiResponse->getResponsePart('next_actions');
1112
echo 'Server: '.$server->name.PHP_EOL;
1213
echo 'IP: '.$server->publicNet->ipv4->ip.PHP_EOL;
1314
echo 'Password: '.$apiResponse->getResponsePart('root_password').PHP_EOL;
1415
echo 'Now we wait on the success of the server creation!'.PHP_EOL;
1516
echo date('H:i:s').PHP_EOL;
1617
$action->waitUntilCompleted();
18+
19+
foreach ($next_actions as $na) {
20+
$na->waitUntilCompleted();
21+
}
1722
echo date('H:i:s').PHP_EOL;
1823
echo 'Done!';

0 commit comments

Comments
 (0)