@@ -46,24 +46,44 @@ func Query() util.CraneCmdError {
46
46
resourceStateList = append (resourceStateList , protos .CranedResourceState_CRANE_MIX )
47
47
case "alloc" :
48
48
resourceStateList = append (resourceStateList , protos .CranedResourceState_CRANE_ALLOC )
49
- case "down" :
50
- resourceStateList = append (resourceStateList , protos .CranedResourceState_CRANE_DOWN )
51
- case "none" :
52
- controlStateList = append (controlStateList , protos .CranedControlState_CRANE_NONE )
53
- case "drain" :
54
- controlStateList = append (controlStateList , protos .CranedControlState_CRANE_DRAIN )
49
+ case "sleeped" :
50
+ resourceStateList = append (resourceStateList , protos .CranedResourceState_CRANE_SLEEPED )
51
+ case "shutdown" :
52
+ resourceStateList = append (resourceStateList , protos .CranedResourceState_CRANE_SHUTDOWN )
53
+ case "waking" :
54
+ resourceStateList = append (resourceStateList , protos .CranedResourceState_CRANE_WAKING_UP )
55
+ case "preparing_sleep" :
56
+ resourceStateList = append (resourceStateList , protos .CranedResourceState_CRANE_PREPARING_SLEEP )
57
+ case "poweringup" :
58
+ resourceStateList = append (resourceStateList , protos .CranedResourceState_CRANE_POWERING_UP )
59
+ case "shuttingdown" :
60
+ resourceStateList = append (resourceStateList , protos .CranedResourceState_CRANE_SHUTTING_DOWN )
61
+ case "unknown" :
62
+ resourceStateList = append (resourceStateList , protos .CranedResourceState_CRANE_UNKNOWN )
55
63
default :
56
64
log .Errorf ("Invalid state given: %s.\n " , FlagFilterCranedStates [i ])
57
65
return util .ErrorCmdArg
58
66
}
59
67
}
68
+
69
+ serviceUnavailableStateList := []protos.CranedResourceState {
70
+ protos .CranedResourceState_CRANE_SLEEPED ,
71
+ protos .CranedResourceState_CRANE_SHUTDOWN ,
72
+ protos .CranedResourceState_CRANE_WAKING_UP ,
73
+ protos .CranedResourceState_CRANE_PREPARING_SLEEP ,
74
+ protos .CranedResourceState_CRANE_POWERING_UP ,
75
+ protos .CranedResourceState_CRANE_SHUTTING_DOWN ,
76
+ protos .CranedResourceState_CRANE_UNKNOWN ,
77
+ }
78
+
60
79
if len (resourceStateList ) == 0 {
61
80
if FlagFilterRespondingOnly {
62
81
resourceStateList = append (resourceStateList , protos .CranedResourceState_CRANE_IDLE , protos .CranedResourceState_CRANE_MIX , protos .CranedResourceState_CRANE_ALLOC )
63
82
} else if FlagFilterDownOnly {
64
- resourceStateList = append (resourceStateList , protos . CranedResourceState_CRANE_DOWN )
83
+ resourceStateList = append (resourceStateList , serviceUnavailableStateList ... )
65
84
} else {
66
- resourceStateList = append (resourceStateList , protos .CranedResourceState_CRANE_IDLE , protos .CranedResourceState_CRANE_MIX , protos .CranedResourceState_CRANE_ALLOC , protos .CranedResourceState_CRANE_DOWN )
85
+ resourceStateList = append (resourceStateList , protos .CranedResourceState_CRANE_IDLE , protos .CranedResourceState_CRANE_MIX , protos .CranedResourceState_CRANE_ALLOC )
86
+ resourceStateList = append (resourceStateList , serviceUnavailableStateList ... )
67
87
}
68
88
}
69
89
if len (controlStateList ) == 0 {
0 commit comments