Changing client to reflect monitor changes
This commit is contained in:
parent
1fd07b5007
commit
bd008dbb39
1 changed files with 6 additions and 8 deletions
|
@ -513,17 +513,15 @@ func main() {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Monitor change to DRAINING and DRAINED mode
|
// Monitor change to DRAINING and DRAINED mode
|
||||||
nontransitioned, err := monitor.HostMaintenance(
|
hostResult, err := monitor.HostMaintenance(
|
||||||
hosts,
|
hosts,
|
||||||
[]aurora.MaintenanceMode{aurora.MaintenanceMode_DRAINED, aurora.MaintenanceMode_DRAINING},
|
[]aurora.MaintenanceMode{aurora.MaintenanceMode_DRAINED, aurora.MaintenanceMode_DRAINING},
|
||||||
5,
|
5,
|
||||||
10)
|
10)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
fmt.Println("Partial success:")
|
||||||
// Check whether the call was partially successful
|
for host, ok := range hostResult {
|
||||||
if len(nontransitioned) != 0 {
|
if !ok {
|
||||||
fmt.Println("Partial success:")
|
|
||||||
for host, _ := range nontransitioned {
|
|
||||||
fmt.Printf("Host %s did not transtion into desired mode(s)\n", host)
|
fmt.Printf("Host %s did not transtion into desired mode(s)\n", host)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -548,14 +546,14 @@ func main() {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Monitor change to DRAINING and DRAINED mode
|
// Monitor change to DRAINING and DRAINED mode
|
||||||
hostsResult, err := monitor.HostMaintenance(
|
hostResult, err := monitor.HostMaintenance(
|
||||||
hosts,
|
hosts,
|
||||||
[]aurora.MaintenanceMode{aurora.MaintenanceMode_NONE},
|
[]aurora.MaintenanceMode{aurora.MaintenanceMode_NONE},
|
||||||
5,
|
5,
|
||||||
10)
|
10)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println("Partial success:")
|
fmt.Println("Partial success:")
|
||||||
for host, ok := range hostsResult {
|
for host, ok := range hostResult {
|
||||||
if !ok {
|
if !ok {
|
||||||
fmt.Printf("Host %s did not transtion into desired mode(s)\n", host)
|
fmt.Printf("Host %s did not transtion into desired mode(s)\n", host)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue