add IsResourceHeavy() to command interface

This commit is contained in:
chrislu 2024-09-28 20:22:57 -07:00
parent dad3a26fb6
commit 701abbb9df
73 changed files with 295 additions and 2 deletions

View File

@ -32,6 +32,10 @@ func (c *commandClusterCheck) Help() string {
`
}
func (c *commandClusterCheck) IsResourceHeavy() bool {
return false
}
func (c *commandClusterCheck) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) {
clusterPsCommand := flag.NewFlagSet(c.Name(), flag.ContinueOnError)

View File

@ -35,6 +35,10 @@ func (c *commandClusterPs) Help() string {
`
}
func (c *commandClusterPs) IsResourceHeavy() bool {
return false
}
func (c *commandClusterPs) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) {
clusterPsCommand := flag.NewFlagSet(c.Name(), flag.ContinueOnError)

View File

@ -27,6 +27,10 @@ func (c *commandRaftServerAdd) Help() string {
`
}
func (c *commandRaftServerAdd) IsResourceHeavy() bool {
return false
}
func (c *commandRaftServerAdd) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) {
raftServerAddCommand := flag.NewFlagSet(c.Name(), flag.ContinueOnError)

View File

@ -26,6 +26,10 @@ func (c *commandRaftClusterPs) Help() string {
`
}
func (c *commandRaftClusterPs) IsResourceHeavy() bool {
return false
}
func (c *commandRaftClusterPs) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) {
raftClusterPsCommand := flag.NewFlagSet(c.Name(), flag.ContinueOnError)

View File

@ -27,6 +27,10 @@ func (c *commandRaftServerRemove) Help() string {
`
}
func (c *commandRaftServerRemove) IsResourceHeavy() bool {
return false
}
func (c *commandRaftServerRemove) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) {
raftServerAddCommand := flag.NewFlagSet(c.Name(), flag.ContinueOnError)

View File

@ -28,6 +28,10 @@ func (c *commandCollectionDelete) Help() string {
`
}
func (c *commandCollectionDelete) IsResourceHeavy() bool {
return false
}
func (c *commandCollectionDelete) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) {
colDeleteCommand := flag.NewFlagSet(c.Name(), flag.ContinueOnError)

View File

@ -23,6 +23,10 @@ func (c *commandCollectionList) Help() string {
return `list all collections`
}
func (c *commandCollectionList) IsResourceHeavy() bool {
return false
}
type CollectionInfo struct {
FileCount float64
DeleteCount float64

View File

@ -98,6 +98,10 @@ func (c *commandEcBalance) Help() string {
`
}
func (c *commandEcBalance) IsResourceHeavy() bool {
return false
}
func (c *commandEcBalance) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) {
balanceCommand := flag.NewFlagSet(c.Name(), flag.ContinueOnError)

View File

@ -37,6 +37,10 @@ func (c *commandEcDecode) Help() string {
`
}
func (c *commandEcDecode) IsResourceHeavy() bool {
return false
}
func (c *commandEcDecode) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) {
decodeCommand := flag.NewFlagSet(c.Name(), flag.ContinueOnError)
volumeId := decodeCommand.Int("volumeId", 0, "the volume id")

View File

@ -56,6 +56,10 @@ func (c *commandEcEncode) Help() string {
`
}
func (c *commandEcEncode) IsResourceHeavy() bool {
return false
}
func (c *commandEcEncode) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) {
encodeCommand := flag.NewFlagSet(c.Name(), flag.ContinueOnError)

View File

@ -55,6 +55,10 @@ func (c *commandEcRebuild) Help() string {
`
}
func (c *commandEcRebuild) IsResourceHeavy() bool {
return false
}
func (c *commandEcRebuild) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) {
fixCommand := flag.NewFlagSet(c.Name(), flag.ContinueOnError)

View File

@ -26,6 +26,10 @@ func (c *commandFsCat) Help() string {
`
}
func (c *commandFsCat) IsResourceHeavy() bool {
return false
}
func (c *commandFsCat) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) {
path, err := commandEnv.parseUrl(findInputDirectory(args))

View File

@ -28,6 +28,10 @@ func (c *commandFsCd) Help() string {
`
}
func (c *commandFsCd) IsResourceHeavy() bool {
return false
}
func (c *commandFsCd) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) {
path, err := commandEnv.parseUrl(findInputDirectory(args))

View File

@ -46,6 +46,10 @@ func (c *commandFsConfigure) Help() string {
`
}
func (c *commandFsConfigure) IsResourceHeavy() bool {
return false
}
func (c *commandFsConfigure) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) {
fsConfigureCommand := flag.NewFlagSet(c.Name(), flag.ContinueOnError)

View File

@ -29,6 +29,10 @@ func (c *commandFsDu) Help() string {
`
}
func (c *commandFsDu) IsResourceHeavy() bool {
return false
}
func (c *commandFsDu) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) {
path, err := commandEnv.parseUrl(findInputDirectory(args))

View File

@ -27,6 +27,10 @@ func (c *commandFsLogPurge) Help() string {
`
}
func (c *commandFsLogPurge) IsResourceHeavy() bool {
return false
}
func (c *commandFsLogPurge) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) {
fsLogPurgeCommand := flag.NewFlagSet(c.Name(), flag.ContinueOnError)
daysAgo := fsLogPurgeCommand.Uint("daysAgo", 365, "purge logs older than N days")

View File

@ -33,6 +33,10 @@ func (c *commandFsLs) Help() string {
`
}
func (c *commandFsLs) IsResourceHeavy() bool {
return false
}
func (c *commandFsLs) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) {
var isLongFormat, showHidden bool

View File

@ -44,6 +44,10 @@ func (c *commandFsMergeVolumes) Help() string {
`
}
func (c *commandFsMergeVolumes) IsResourceHeavy() bool {
return false
}
func (c *commandFsMergeVolumes) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) {
fsMergeVolumesCommand := flag.NewFlagSet(c.Name(), flag.ContinueOnError)

View File

@ -30,6 +30,10 @@ func (c *commandFsMetaCat) Help() string {
`
}
func (c *commandFsMetaCat) IsResourceHeavy() bool {
return false
}
func (c *commandFsMetaCat) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) {
path, err := commandEnv.parseUrl(findInputDirectory(args))

View File

@ -37,6 +37,10 @@ func (c *commandFsMetaChangeVolumeId) Help() string {
`
}
func (c *commandFsMetaChangeVolumeId) IsResourceHeavy() bool {
return false
}
func (c *commandFsMetaChangeVolumeId) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) {
fsMetaChangeVolumeIdCommand := flag.NewFlagSet(c.Name(), flag.ContinueOnError)

View File

@ -38,6 +38,10 @@ func (c *commandFsMetaLoad) Help() string {
`
}
func (c *commandFsMetaLoad) IsResourceHeavy() bool {
return false
}
func (c *commandFsMetaLoad) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) {
if len(args) == 0 {

View File

@ -30,6 +30,10 @@ func (c *commandFsMetaNotify) Help() string {
`
}
func (c *commandFsMetaNotify) IsResourceHeavy() bool {
return false
}
func (c *commandFsMetaNotify) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) {
path, err := commandEnv.parseUrl(findInputDirectory(args))

View File

@ -44,6 +44,10 @@ func (c *commandFsMetaSave) Help() string {
`
}
func (c *commandFsMetaSave) IsResourceHeavy() bool {
return false
}
func (c *commandFsMetaSave) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) {
fsMetaSaveCommand := flag.NewFlagSet(c.Name(), flag.ContinueOnError)

View File

@ -27,6 +27,10 @@ func (c *commandFsMkdir) Help() string {
`
}
func (c *commandFsMkdir) IsResourceHeavy() bool {
return false
}
func (c *commandFsMkdir) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) {
path, err := commandEnv.parseUrl(findInputDirectory(args))

View File

@ -34,6 +34,10 @@ func (c *commandFsMv) Help() string {
`
}
func (c *commandFsMv) IsResourceHeavy() bool {
return false
}
func (c *commandFsMv) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) {
if len(args) != 2 {

View File

@ -20,6 +20,10 @@ func (c *commandFsPwd) Help() string {
return `print out current directory`
}
func (c *commandFsPwd) IsResourceHeavy() bool {
return false
}
func (c *commandFsPwd) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) {
fmt.Fprintf(writer, "%s\n", commandEnv.option.Directory)

View File

@ -34,6 +34,10 @@ func (c *commandFsRm) Help() string {
`
}
func (c *commandFsRm) IsResourceHeavy() bool {
return false
}
func (c *commandFsRm) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) {
isRecursive := false
ignoreRecursiveError := false

View File

@ -28,6 +28,10 @@ func (c *commandFsTree) Help() string {
`
}
func (c *commandFsTree) IsResourceHeavy() bool {
return false
}
func (c *commandFsTree) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) {
path, err := commandEnv.parseUrl(findInputDirectory(args))

View File

@ -51,6 +51,10 @@ func (c *commandFsVerify) Help() string {
`
}
func (c *commandFsVerify) IsResourceHeavy() bool {
return false
}
func (c *commandFsVerify) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) {
c.env = commandEnv
c.writer = writer

View File

@ -25,6 +25,10 @@ func (c *commandLock) Help() string {
`
}
func (c *commandLock) IsResourceHeavy() bool {
return false
}
func (c *commandLock) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) {
commandEnv.locker.RequestLock(util.DetectedHostAddress())
@ -47,6 +51,10 @@ func (c *commandUnlock) Help() string {
`
}
func (c *commandUnlock) IsResourceHeavy() bool {
return false
}
func (c *commandUnlock) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) {
commandEnv.locker.ReleaseLock()

View File

@ -34,6 +34,10 @@ func (c *commandMountConfigure) Help() string {
`
}
func (c *commandMountConfigure) IsResourceHeavy() bool {
return false
}
func (c *commandMountConfigure) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) {
mountConfigureCommand := flag.NewFlagSet(c.Name(), flag.ContinueOnError)

View File

@ -25,6 +25,10 @@ func (c *commandMqBalanceTopics) Help() string {
`
}
func (c *commandMqBalanceTopics) IsResourceHeavy() bool {
return false
}
func (c *commandMqBalanceTopics) Do(args []string, commandEnv *CommandEnv, writer io.Writer) error {
// find the broker balancer

View File

@ -29,6 +29,10 @@ func (c *commandMqTopicConfigure) Help() string {
`
}
func (c *commandMqTopicConfigure) IsResourceHeavy() bool {
return false
}
func (c *commandMqTopicConfigure) Do(args []string, commandEnv *CommandEnv, writer io.Writer) error {
// parse parameters

View File

@ -24,6 +24,10 @@ func (c *commandMqTopicDescribe) Help() string {
return `describe a topic`
}
func (c *commandMqTopicDescribe) IsResourceHeavy() bool {
return false
}
func (c *commandMqTopicDescribe) Do(args []string, commandEnv *CommandEnv, writer io.Writer) error {
// parse parameters
mqCommand := flag.NewFlagSet(c.Name(), flag.ContinueOnError)

View File

@ -25,6 +25,10 @@ func (c *commandMqTopicList) Help() string {
return `print out all topics`
}
func (c *commandMqTopicList) IsResourceHeavy() bool {
return false
}
func (c *commandMqTopicList) Do(args []string, commandEnv *CommandEnv, writer io.Writer) error {
brokerBalancer, err := findBrokerBalancer(commandEnv)

View File

@ -46,6 +46,10 @@ func (c *commandRemoteCache) Help() string {
`
}
func (c *commandRemoteCache) IsResourceHeavy() bool {
return false
}
func (c *commandRemoteCache) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) {
remoteMountCommand := flag.NewFlagSet(c.Name(), flag.ContinueOnError)

View File

@ -48,6 +48,10 @@ func (c *commandRemoteConfigure) Help() string {
`
}
func (c *commandRemoteConfigure) IsResourceHeavy() bool {
return false
}
var (
isAlpha = regexp.MustCompile(`^[A-Za-z][A-Za-z0-9]*$`).MatchString
)

View File

@ -44,6 +44,10 @@ func (c *commandRemoteMetaSync) Help() string {
`
}
func (c *commandRemoteMetaSync) IsResourceHeavy() bool {
return false
}
func (c *commandRemoteMetaSync) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) {
remoteMetaSyncCommand := flag.NewFlagSet(c.Name(), flag.ContinueOnError)

View File

@ -44,6 +44,10 @@ func (c *commandRemoteMount) Help() string {
`
}
func (c *commandRemoteMount) IsResourceHeavy() bool {
return false
}
func (c *commandRemoteMount) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) {
remoteMountCommand := flag.NewFlagSet(c.Name(), flag.ContinueOnError)

View File

@ -38,6 +38,10 @@ func (c *commandRemoteMountBuckets) Help() string {
`
}
func (c *commandRemoteMountBuckets) IsResourceHeavy() bool {
return false
}
func (c *commandRemoteMountBuckets) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) {
remoteMountBucketsCommand := flag.NewFlagSet(c.Name(), flag.ContinueOnError)

View File

@ -41,6 +41,10 @@ func (c *commandRemoteUncache) Help() string {
`
}
func (c *commandRemoteUncache) IsResourceHeavy() bool {
return false
}
func (c *commandRemoteUncache) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) {
remoteUncacheCommand := flag.NewFlagSet(c.Name(), flag.ContinueOnError)
@ -165,12 +169,12 @@ func (ff *FileFilter) matches(entry *filer_pb.Entry) bool {
}
}
if *ff.minAge != -1 {
if entry.Attributes.Crtime + *ff.minAge > time.Now().Unix() {
if entry.Attributes.Crtime+*ff.minAge > time.Now().Unix() {
return false
}
}
if *ff.maxAge != -1 {
if entry.Attributes.Crtime + *ff.maxAge < time.Now().Unix() {
if entry.Attributes.Crtime+*ff.maxAge < time.Now().Unix() {
return false
}
}

View File

@ -37,6 +37,10 @@ func (c *commandRemoteUnmount) Help() string {
`
}
func (c *commandRemoteUnmount) IsResourceHeavy() bool {
return false
}
func (c *commandRemoteUnmount) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) {
remoteMountCommand := flag.NewFlagSet(c.Name(), flag.ContinueOnError)

View File

@ -30,6 +30,10 @@ func (c *commandS3BucketCreate) Help() string {
`
}
func (c *commandS3BucketCreate) IsResourceHeavy() bool {
return false
}
func (c *commandS3BucketCreate) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) {
bucketCommand := flag.NewFlagSet(c.Name(), flag.ContinueOnError)

View File

@ -28,6 +28,10 @@ func (c *commandS3BucketDelete) Help() string {
`
}
func (c *commandS3BucketDelete) IsResourceHeavy() bool {
return false
}
func (c *commandS3BucketDelete) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) {
bucketCommand := flag.NewFlagSet(c.Name(), flag.ContinueOnError)

View File

@ -27,6 +27,10 @@ func (c *commandS3BucketList) Help() string {
`
}
func (c *commandS3BucketList) IsResourceHeavy() bool {
return false
}
func (c *commandS3BucketList) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) {
bucketCommand := flag.NewFlagSet(c.Name(), flag.ContinueOnError)

View File

@ -28,6 +28,10 @@ func (c *commandS3BucketQuota) Help() string {
`
}
func (c *commandS3BucketQuota) IsResourceHeavy() bool {
return false
}
func (c *commandS3BucketQuota) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) {
bucketCommand := flag.NewFlagSet(c.Name(), flag.ContinueOnError)

View File

@ -29,6 +29,10 @@ func (c *commandS3BucketQuotaEnforce) Help() string {
`
}
func (c *commandS3BucketQuotaEnforce) IsResourceHeavy() bool {
return false
}
func (c *commandS3BucketQuotaEnforce) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) {
bucketCommand := flag.NewFlagSet(c.Name(), flag.ContinueOnError)

View File

@ -51,6 +51,10 @@ func (c *commandS3CircuitBreaker) Help() string {
`
}
func (c *commandS3CircuitBreaker) IsResourceHeavy() bool {
return false
}
func (c *commandS3CircuitBreaker) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) {
dir := s3_constants.CircuitBreakerConfigDir
file := s3_constants.CircuitBreakerConfigFile

View File

@ -34,6 +34,10 @@ func (c *commandS3CleanUploads) Help() string {
`
}
func (c *commandS3CleanUploads) IsResourceHeavy() bool {
return false
}
func (c *commandS3CleanUploads) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) {
bucketCommand := flag.NewFlagSet(c.Name(), flag.ContinueOnError)
uploadedTimeAgo := bucketCommand.Duration("timeAgo", 24*time.Hour, "created time before now. \"1.5h\" or \"2h45m\". Valid time units are \"m\", \"h\"")

View File

@ -33,6 +33,10 @@ func (c *commandS3Configure) Help() string {
`
}
func (c *commandS3Configure) IsResourceHeavy() bool {
return false
}
func (c *commandS3Configure) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) {
s3ConfigureCommand := flag.NewFlagSet(c.Name(), flag.ContinueOnError)

View File

@ -64,6 +64,10 @@ func (c *commandVolumeBalance) Help() string {
`
}
func (c *commandVolumeBalance) IsResourceHeavy() bool {
return false
}
func (c *commandVolumeBalance) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) {
balanceCommand := flag.NewFlagSet(c.Name(), flag.ContinueOnError)

View File

@ -48,6 +48,10 @@ func (c *commandVolumeCheckDisk) Help() string {
`
}
func (c *commandVolumeCheckDisk) IsResourceHeavy() bool {
return false
}
func (c *commandVolumeCheckDisk) getVolumeStatusFileCount(vid uint32, dn *master_pb.DataNodeInfo) (totalFileCount, deletedFileCount uint64) {
err := operation.WithVolumeServerClient(false, pb.NewServerAddressWithGrpcPort(dn.Id, int(dn.GrpcPort)), c.env.option.GrpcDialOption, func(volumeServerClient volume_server_pb.VolumeServerClient) error {
resp, reqErr := volumeServerClient.VolumeStatus(context.Background(), &volume_server_pb.VolumeStatusRequest{

View File

@ -35,6 +35,10 @@ func (c *commandVolumeConfigureReplication) Help() string {
`
}
func (c *commandVolumeConfigureReplication) IsResourceHeavy() bool {
return false
}
func (c *commandVolumeConfigureReplication) Do(args []string, commandEnv *CommandEnv, _ io.Writer) (err error) {
configureReplicationCommand := flag.NewFlagSet(c.Name(), flag.ContinueOnError)

View File

@ -31,6 +31,10 @@ func (c *commandVolumeCopy) Help() string {
`
}
func (c *commandVolumeCopy) IsResourceHeavy() bool {
return false
}
func (c *commandVolumeCopy) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) {
volCopyCommand := flag.NewFlagSet(c.Name(), flag.ContinueOnError)

View File

@ -29,6 +29,10 @@ func (c *commandVolumeDelete) Help() string {
`
}
func (c *commandVolumeDelete) IsResourceHeavy() bool {
return false
}
func (c *commandVolumeDelete) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) {
volDeleteCommand := flag.NewFlagSet(c.Name(), flag.ContinueOnError)

View File

@ -32,6 +32,10 @@ func (c *commandVolumeDeleteEmpty) Help() string {
`
}
func (c *commandVolumeDeleteEmpty) IsResourceHeavy() bool {
return false
}
func (c *commandVolumeDeleteEmpty) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) {
volDeleteCommand := flag.NewFlagSet(c.Name(), flag.ContinueOnError)

View File

@ -55,6 +55,10 @@ func (c *commandVolumeFixReplication) Help() string {
`
}
func (c *commandVolumeFixReplication) IsResourceHeavy() bool {
return false
}
func (c *commandVolumeFixReplication) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) {
volFixReplicationCommand := flag.NewFlagSet(c.Name(), flag.ContinueOnError)

View File

@ -79,6 +79,10 @@ func (c *commandVolumeFsck) Help() string {
`
}
func (c *commandVolumeFsck) IsResourceHeavy() bool {
return false
}
func (c *commandVolumeFsck) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) {
fsckCommand := flag.NewFlagSet(c.Name(), flag.ContinueOnError)

View File

@ -30,6 +30,10 @@ func (c *commandGrow) Help() string {
`
}
func (c *commandGrow) IsResourceHeavy() bool {
return false
}
func (c *commandGrow) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) {
volumeVacuumCommand := flag.NewFlagSet(c.Name(), flag.ContinueOnError)

View File

@ -39,6 +39,10 @@ func (c *commandVolumeList) Help() string {
`
}
func (c *commandVolumeList) IsResourceHeavy() bool {
return false
}
func (c *commandVolumeList) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) {
volumeListCommand := flag.NewFlagSet(c.Name(), flag.ContinueOnError)

View File

@ -28,6 +28,10 @@ func (c *commandVolumeMark) Help() string {
`
}
func (c *commandVolumeMark) IsResourceHeavy() bool {
return false
}
func (c *commandVolumeMark) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) {
volMarkCommand := flag.NewFlagSet(c.Name(), flag.ContinueOnError)

View File

@ -33,6 +33,10 @@ func (c *commandVolumeMount) Help() string {
`
}
func (c *commandVolumeMount) IsResourceHeavy() bool {
return false
}
func (c *commandVolumeMount) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) {
volMountCommand := flag.NewFlagSet(c.Name(), flag.ContinueOnError)

View File

@ -49,6 +49,10 @@ func (c *commandVolumeMove) Help() string {
`
}
func (c *commandVolumeMove) IsResourceHeavy() bool {
return false
}
func (c *commandVolumeMove) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) {
volMoveCommand := flag.NewFlagSet(c.Name(), flag.ContinueOnError)

View File

@ -46,6 +46,10 @@ func (c *commandVolumeServerEvacuate) Help() string {
`
}
func (c *commandVolumeServerEvacuate) IsResourceHeavy() bool {
return false
}
func (c *commandVolumeServerEvacuate) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) {
vsEvacuateCommand := flag.NewFlagSet(c.Name(), flag.ContinueOnError)

View File

@ -35,6 +35,10 @@ func (c *commandVolumeServerLeave) Help() string {
`
}
func (c *commandVolumeServerLeave) IsResourceHeavy() bool {
return false
}
func (c *commandVolumeServerLeave) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) {
vsLeaveCommand := flag.NewFlagSet(c.Name(), flag.ContinueOnError)

View File

@ -41,6 +41,10 @@ func (c *commandVolumeTierDownload) Help() string {
`
}
func (c *commandVolumeTierDownload) IsResourceHeavy() bool {
return false
}
func (c *commandVolumeTierDownload) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) {
tierCommand := flag.NewFlagSet(c.Name(), flag.ContinueOnError)

View File

@ -53,6 +53,10 @@ func (c *commandVolumeTierMove) Help() string {
`
}
func (c *commandVolumeTierMove) IsResourceHeavy() bool {
return false
}
func (c *commandVolumeTierMove) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) {
tierCommand := flag.NewFlagSet(c.Name(), flag.ContinueOnError)

View File

@ -56,6 +56,10 @@ func (c *commandVolumeTierUpload) Help() string {
`
}
func (c *commandVolumeTierUpload) IsResourceHeavy() bool {
return false
}
func (c *commandVolumeTierUpload) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) {
tierCommand := flag.NewFlagSet(c.Name(), flag.ContinueOnError)

View File

@ -34,6 +34,10 @@ func (c *commandVolumeUnmount) Help() string {
`
}
func (c *commandVolumeUnmount) IsResourceHeavy() bool {
return false
}
func (c *commandVolumeUnmount) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) {
volUnmountCommand := flag.NewFlagSet(c.Name(), flag.ContinueOnError)

View File

@ -27,6 +27,10 @@ func (c *commandVacuum) Help() string {
`
}
func (c *commandVacuum) IsResourceHeavy() bool {
return false
}
func (c *commandVacuum) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) {
volumeVacuumCommand := flag.NewFlagSet(c.Name(), flag.ContinueOnError)

View File

@ -26,6 +26,10 @@ func (c *commandDisableVacuum) Help() string {
`
}
func (c *commandDisableVacuum) IsResourceHeavy() bool {
return false
}
func (c *commandDisableVacuum) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) {
if err = commandEnv.confirmIsLocked(args); err != nil {

View File

@ -26,6 +26,10 @@ func (c *commandEnableVacuum) Help() string {
`
}
func (c *commandEnableVacuum) IsResourceHeavy() bool {
return false
}
func (c *commandEnableVacuum) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) {
if err = commandEnv.confirmIsLocked(args); err != nil {

View File

@ -42,6 +42,7 @@ type command interface {
Name() string
Help() string
Do([]string, *CommandEnv, io.Writer) error
IsResourceHeavy() bool
}
var (