2023-04-25 12:09:20 +00:00
|
|
|
package control
|
|
|
|
|
2023-11-07 14:35:09 +00:00
|
|
|
import (
|
|
|
|
commonCmd "git.frostfs.info/TrueCloudLab/frostfs-node/cmd/internal/common"
|
|
|
|
"github.com/spf13/cobra"
|
|
|
|
)
|
2023-04-25 12:09:20 +00:00
|
|
|
|
|
|
|
var irCmd = &cobra.Command{
|
|
|
|
Use: "ir",
|
|
|
|
Short: "Operations with inner ring nodes",
|
|
|
|
Long: "Operations with inner ring nodes",
|
|
|
|
}
|
|
|
|
|
|
|
|
func initControlIRCmd() {
|
|
|
|
irCmd.AddCommand(tickEpochCmd)
|
2023-05-03 13:19:46 +00:00
|
|
|
irCmd.AddCommand(removeNodeCmd)
|
2023-05-18 10:08:05 +00:00
|
|
|
irCmd.AddCommand(irHealthCheckCmd)
|
2023-10-16 15:15:04 +00:00
|
|
|
irCmd.AddCommand(removeContainerCmd)
|
2023-04-25 12:09:20 +00:00
|
|
|
|
|
|
|
initControlIRTickEpochCmd()
|
2023-05-03 13:19:46 +00:00
|
|
|
initControlIRRemoveNodeCmd()
|
2023-05-18 10:08:05 +00:00
|
|
|
initControlIRHealthCheckCmd()
|
2023-10-16 15:15:04 +00:00
|
|
|
initControlIRRemoveContainerCmd()
|
2023-04-25 12:09:20 +00:00
|
|
|
}
|
2023-11-07 14:35:09 +00:00
|
|
|
|
|
|
|
func printVUB(cmd *cobra.Command, vub uint32) {
|
|
|
|
cmd.Printf("Transaction's valid until block is %d\n", vub)
|
|
|
|
}
|
|
|
|
|
|
|
|
func parseVUB(cmd *cobra.Command) uint32 {
|
|
|
|
vub, err := cmd.Flags().GetUint32(irFlagNameVUB)
|
|
|
|
commonCmd.ExitOnErr(cmd, "invalid valid until block value: %w", err)
|
|
|
|
return vub
|
|
|
|
}
|