-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e9ab838
commit bdb3879
Showing
25 changed files
with
185 additions
and
102 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?php | ||
require_once __DIR__.'/../vendor/autoload.php'; | ||
$apiKey = '{InsertYourAPIKeyHear}'; | ||
|
||
$hetznerClient = new \LKDev\HetznerCloud\HetznerAPIClient($apiKey); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?php | ||
require_once __DIR__.'/../bootstrap.php'; | ||
|
||
$servers = new \LKDev\HetznerCloud\Models\Servers\Servers(); | ||
$serverId = 494200; | ||
$server = $servers->get($serverId); | ||
var_dump($server); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?php | ||
require_once __DIR__.'/../bootstrap.php'; | ||
|
||
$servers = new \LKDev\HetznerCloud\Models\Servers\Servers(); | ||
$serverTypes = new \LKDev\HetznerCloud\Models\Servers\Types\ServerTypes(); | ||
foreach ($serverTypes->all() as $serverType) { | ||
echo $serverType->name.PHP_EOL; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?php | ||
require_once __DIR__.'/../bootstrap.php'; | ||
|
||
$servers = new \LKDev\HetznerCloud\Models\Servers\Servers(); | ||
foreach ($servers->all() as $server) { | ||
echo 'ID: '.$server->id.' Name:'.$server->name.' Status: '.$server->status.PHP_EOL; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?php | ||
require_once __DIR__.'/../bootstrap.php'; | ||
|
||
$servers = new \LKDev\HetznerCloud\Models\Servers\Servers(); | ||
$serverId = 494200; | ||
$server = $servers->get($serverId); | ||
echo 'Server: '.$server->name.PHP_EOL; | ||
echo "Perform Shutdown now:".PHP_EOL; | ||
/** | ||
* @var \LKDev\HetznerCloud\Models\Servers\Server $server | ||
*/ | ||
$action = $server->shutdown(); | ||
|
||
echo "Reply from API: Action ID: ".$action->id.' '.$action->command.' '.$action->started.PHP_EOL; | ||
|
||
echo 'Wait some seconds that the server could shutdown.'.PHP_EOL; | ||
sleep(5); | ||
echo "Get the Server from the API:".PHP_EOL; | ||
$server = $servers->get($serverId); | ||
echo "Server status: ".$server->status.PHP_EOL; | ||
echo "Let's start it again!"; | ||
$server->powerOn(); | ||
echo 'Wait some seconds that the server could startup.'.PHP_EOL; | ||
sleep(5); | ||
echo "Get the Server from the API:".PHP_EOL; | ||
$server = $servers->get($serverId); | ||
echo "Server status: ".$server->status.PHP_EOL; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,4 +10,5 @@ | |
|
||
class FloatingIp | ||
{ | ||
// ToDo | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,4 +10,5 @@ | |
|
||
class FloatingIps | ||
{ | ||
// ToDos | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.