MCPcopy
hub / github.com/cubefs/cubefs / newCmdFlashNodeHTTPInactiveDisk

Function newCmdFlashNodeHTTPInactiveDisk

cli/cmd/flashnode.go:282–301  ·  view source on GitHub ↗
(client *master.MasterClient)

Source from the content-addressed store, hash-verified

280}
281
282func newCmdFlashNodeHTTPInactiveDisk(client *master.MasterClient) *cobra.Command {
283 return &cobra.Command{
284 Use: "httpInactiveDisk" + _flashnodeAddr + " [dataPath]",
285 Short: "inactive the disk in flashnode",
286 Args: cobra.MinimumNArgs(2),
287 RunE: func(_ *cobra.Command, args []string) (err error) {
288 addr := args[0]
289 // check flashnode whether exist
290 _, err = client.NodeAPI().GetFlashNode(addr)
291 if err != nil {
292 return
293 }
294 dataPath := args[1]
295 if err = httpclient.New().Addr(addr2Prof(addr)).FlashNode().InactiveDisk(dataPath); err == nil {
296 stdoutlnf("%s inactives dataPath(%s) [OK]", addr, dataPath)
297 }
298 return
299 },
300 }
301}
302
303func showFlashNodesView(flashNodeViewInfos []*proto.FlashNodeViewInfo, showStat bool, groupStats map[uint64]string, tbl table) table {
304 sort.Slice(flashNodeViewInfos, func(i, j int) bool {

Callers 1

newFlashNodeCmdFunction · 0.70

Calls 8

NewFunction · 0.92
NodeAPIMethod · 0.80
FlashNodeMethod · 0.80
addr2ProfFunction · 0.70
stdoutlnfFunction · 0.70
InactiveDiskMethod · 0.65
GetFlashNodeMethod · 0.45
AddrMethod · 0.45

Tested by

no test coverage detected