2017-07-26 20:37:59 +00:00
|
|
|
package google
|
|
|
|
|
|
|
|
import (
|
|
|
|
computeBeta "google.golang.org/api/compute/v0.beta"
|
|
|
|
"google.golang.org/api/compute/v1"
|
|
|
|
)
|
|
|
|
|
|
|
|
func computeSharedOperationWaitZone(config *Config, op interface{}, project string, zone, activity string) error {
|
|
|
|
return computeSharedOperationWaitZoneTime(config, op, project, zone, 4, activity)
|
|
|
|
}
|
|
|
|
|
|
|
|
func computeSharedOperationWaitZoneTime(config *Config, op interface{}, project string, zone string, minutes int, activity string) error {
|
|
|
|
switch op.(type) {
|
|
|
|
case *compute.Operation:
|
2017-07-27 15:48:25 +00:00
|
|
|
return computeOperationWaitTime(config, op.(*compute.Operation), project, activity, minutes)
|
2017-07-26 20:37:59 +00:00
|
|
|
case *computeBeta.Operation:
|
|
|
|
return computeBetaOperationWaitZoneTime(config, op.(*computeBeta.Operation), project, zone, minutes, activity)
|
|
|
|
case nil:
|
|
|
|
panic("Attempted to wait on an Operation that was nil.")
|
|
|
|
default:
|
|
|
|
panic("Attempted to wait on an Operation of unknown type.")
|
|
|
|
}
|
|
|
|
}
|