Files
fx-serverless/commands/list.go
Minghe 884fb65432 Remove path (#162)
* clean up

* remove Path

* fix typo

* add more test

* fix typo

* fix permission issue

* fix server not started issue

* clean up
2018-08-03 00:41:33 +08:00

31 lines
516 B
Go

package commands
import (
"context"
"github.com/metrue/fx/api"
"github.com/metrue/fx/pkg/client"
"github.com/metrue/fx/pkg/utils"
)
// List lists all running function services
func List(address string, functions []string) error {
client, conn, err := client.NewClient(address)
if err != nil {
return err
}
defer conn.Close()
ctx := context.Background()
req := &api.ListRequest{
ID: functions,
}
res, err := client.List(ctx, req)
if err != nil {
return err
}
return utils.OutputJSON(res)
}