-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BatchEnable Operation's response is not working even when APIs are enabled #2178
Comments
Hello @dunefro, thanks for the issue. I don't think there is a bug in the client, but rather in the code that you've shared. The Instead, you need to include a polling request via operations = NewOperationsService(serviceusageServiceClient)
// ...
for {
// ...
} else {
fmt.Println(string(enableOperation.Response))
time.Sleep(3 * time.Second)
// Poll the operation state, loop again to same operation evaluation logic.
enableOperation, err = operations.Get(enableOperation.Name).Do()
if err != nil {
fmt.Println("error polling operation:", err)
return err
}
}
} I can't find a section in our top-level of docs that explain this, so I will add one. Please close this if it works for you or I will close it in a few days as resolved. |
Environment details
go version go1.21.0 darwin/arm64
Steps to reproduce
I am trying to enable certain APIs for my project
for
loop is running indefinitely.target
and notret
, but I am not perfectly sure of this.What should happen
I should either get an error or
operation.Done
should be marked astrue
The text was updated successfully, but these errors were encountered: