Skip to content

Commit 5c885f4

Browse files
committed
Added brancher list command
1 parent b97f037 commit 5c885f4

2 files changed

Lines changed: 14 additions & 2 deletions

File tree

app/Commands/ListBrancherNodes.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
use Illuminate\Console\Scheduling\Schedule;
66
use LaravelZero\Framework\Commands\Command;
7+
use Hypernode\Api\HypernodeClientFactory;
78

89
class ListBrancherNodes extends Command
910
{
@@ -12,7 +13,7 @@ class ListBrancherNodes extends Command
1213
*
1314
* @var string
1415
*/
15-
protected $signature = 'brancher:list';
16+
protected $signature = 'brancher:list {hypernode}';
1617

1718
/**
1819
* The description of the command.
@@ -28,7 +29,13 @@ class ListBrancherNodes extends Command
2829
*/
2930
public function handle()
3031
{
31-
//
32+
$client = HypernodeClientFactory::create(config('hypernode.api_token'));
33+
34+
$originHypernode = $this->argument('hypernode');
35+
36+
$client->brancherApp->list($originHypernode);
37+
38+
print_r($client->brancherApp->list($originHypernode));
3239
}
3340

3441
/**

config/hypernode.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?php
2+
3+
return [
4+
'api_token' => getenv('HYPERNODE_API_TOKEN'),
5+
];

0 commit comments

Comments
 (0)