mirror of
https://github.com/kopia/kopia.git
synced 2026-01-23 05:47:57 -05:00
30 lines
543 B
Go
30 lines
543 B
Go
package cli
|
|
|
|
import (
|
|
"context"
|
|
"fmt"
|
|
|
|
"github.com/kopia/kopia/internal/serverapi"
|
|
)
|
|
|
|
var (
|
|
serverStatusCommand = serverCommands.Command("status", "Status of Kopia server")
|
|
)
|
|
|
|
func init() {
|
|
serverStatusCommand.Action(serverAction(runServerStatus))
|
|
}
|
|
|
|
func runServerStatus(ctx context.Context, cli *serverapi.Client) error {
|
|
var status serverapi.SourcesResponse
|
|
if err := cli.Get("sources", &status); err != nil {
|
|
return err
|
|
}
|
|
|
|
for _, src := range status.Sources {
|
|
fmt.Printf("%15v %v\n", src.Status, src.Source)
|
|
}
|
|
|
|
return nil
|
|
}
|