mirror of
https://github.com/psviderski/uncloud.git
synced 2026-10-07 13:49:02 +00:00
add ListServices method and ls CLI command
This commit is contained in:
1 parent
3ce9c8be04
commit
1fb8a3d7a0
8 files changed
+150
-13
No files matched your search
@@ -32,13 +32,13 @@ func NewListCommand() *cobra.Command {
|
||||
}
|
||||
|
||||
func runList(ctx context.Context, uncli *cli.CLI, clusterName string) error {
|
||||
c, err := uncli.ConnectCluster(ctx, clusterName)
|
||||
client, err := uncli.ConnectCluster(ctx, clusterName)
|
||||
if err != nil {
|
||||
return fmt.Errorf("connect to cluster: %w", err)
|
||||
}
|
||||
defer c.Close()
|
||||
defer client.Close()
|
||||
|
||||
machines, err := c.ListMachines(ctx)
|
||||
machines, err := client.ListMachines(ctx)
|
||||
if err != nil {
|
||||
return fmt.Errorf("list machines: %w", err)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user