Skip to content

Commit

Permalink
OBD Cli Implementation
Browse files Browse the repository at this point in the history
- Periodically get updates from minio as OBD tests are completed on the backend
- Implement a spinner while waiting for data
  • Loading branch information
wlan0 committed Mar 31, 2020
1 parent 06146e8 commit ba3bccd
Show file tree
Hide file tree
Showing 11 changed files with 224 additions and 131 deletions.
10 changes: 4 additions & 6 deletions cmd/admin-config-export.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,8 @@
package cmd

import (
json "github.com/minio/mc/pkg/colorjson"
"fmt"

"github.com/minio/cli"
json "github.com/minio/mc/pkg/colorjson"
"github.com/minio/mc/pkg/probe"
)

Expand All @@ -47,7 +45,7 @@ EXAMPLES:

// configExportMessage container to hold locks information.
type configExportMessage struct {
Status string `json:"status"`
Status string `json:"status"`
Value interface{} `json:"value"`
}

Expand Down Expand Up @@ -87,10 +85,10 @@ func mainAdminConfigExport(ctx *cli.Context) error {
// Call get config API
buf, e := client.GetConfig(globalContext)
fatalIf(probe.NewError(e), "Cannot get server config")

// Print
printMsg(configExportMessage{
Value: fmt.Sprintf("%s", buf),
Value: buf,
})

return nil
Expand Down
2 changes: 1 addition & 1 deletion cmd/admin-config-help.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@
package cmd

import (
json "github.com/minio/mc/pkg/colorjson"
"strings"
"text/tabwriter"
"text/template"

"github.com/fatih/color"
json "github.com/minio/mc/pkg/colorjson"
"github.com/minio/mc/pkg/probe"
"github.com/minio/minio/pkg/madmin"
)
Expand Down
2 changes: 1 addition & 1 deletion cmd/admin-config-import.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@
package cmd

import (
json "github.com/minio/mc/pkg/colorjson"
"fmt"
"os"

"github.com/fatih/color"
"github.com/minio/cli"
json "github.com/minio/mc/pkg/colorjson"
"github.com/minio/mc/pkg/probe"
"github.com/minio/minio/pkg/console"
)
Expand Down
2 changes: 0 additions & 2 deletions cmd/admin-info.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,6 @@ func (u clusterStruct) String() (msg string) {
var totalOnlineDisksCluster int
var totalOfflineDisksCluster int

// Dot represents server status, online (green) or offline (red)
dot := "●"
// Color palette initialization
console.SetColor("Info", color.New(color.FgGreen, color.Bold))
console.SetColor("InfoFail", color.New(color.FgRed, color.Bold))
Expand Down
7 changes: 7 additions & 0 deletions cmd/admin-main.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@ var (
adminFlags = []cli.Flag{}
)

const (
// dot represents a list item, for eg. server status - online (green) or offline (red)
dot = "●"
// check represents successful operation
check = "✔"
)

var adminCmd = cli.Command{
Name: "admin",
Usage: "manage MinIO servers",
Expand Down
Loading

0 comments on commit ba3bccd

Please sign in to comment.