Files
kopia/cli/command_server_status.go
Jarek Kowalski be4b897579 Support for remote repository (#427)
Support for remote content repository where all contents and
manifests are fetched over HTTP(S) instead of locally
manipulating blob storage

* server: implement content and manifest access APIs
* apiclient: moved Kopia API client to separate package
* content: exposed content.ValidatePrefix()
* manifest: added JSON serialization attributes to EntryMetadata
* repo: changed repo.Open() to return Repository instead of *DirectRepository
* repo: added apiServerRepository
* cli: added 'kopia repository connect server'
  This sets up repository connection via the API server instead of
  directly-manipulated storage.
* server: add support for specifying a list of usernames/password via --htpasswd-file
* tests: added API server repository E2E test
* server: only return manifests (policies and snapshots) belonging to authenticated user
2020-05-02 21:41:49 -07:00

31 lines
606 B
Go

package cli
import (
"context"
"fmt"
"github.com/kopia/kopia/internal/apiclient"
"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 *apiclient.KopiaAPIClient) error {
var status serverapi.SourcesResponse
if err := cli.Get(ctx, "sources", nil, &status); err != nil {
return err
}
for _, src := range status.Sources {
fmt.Printf("%15v %v\n", src.Status, src.Source)
}
return nil
}