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
Issue calling CloudProviderSnapshotBackupPolicies Service #349
Comments
Hi @makubit can you please provide a sample application that reproduces the error? |
Sure, the code is pretty easy, just call the mentioned service:
Btw It would be easier to understand this service if there were named parameters in the code:
|
Hi @makubit I took your example to make it complete and I'm not able to reproduce package main
import (
"context"
"fmt"
"github.com/mongodb-forks/digest"
"go.mongodb.org/atlas/mongodbatlas"
)
func main() {
t := digest.NewTransport("public-key", "private-key")
tc, err := t.Client()
if err != nil {
panic(err)
}
mcli, _ := mongodbatlas.NewClient(tc)
ps, _, err := mcli.CloudProviderSnapshotBackupPolicies.Get(context.TODO(), "project-id", "cluster-name")
if err != nil {
panic(err)
}
fmt.Println(ps) // works
}
Feel free to open a PR to improve this |
I also tested this via the CLI and atlas backups schedule describe <clusterName> -o json also works as expected This feels like it may be a configuration issue the client on your side and why the closer your example is to how you are using it it would be better for us to diagnose |
@gssbzn Thanks for checking! I noticed that one of my conditions was wrong - I didn't wait for the finishing of cluster provisioning and that was the issue (I didn't notice as the message doesn't directly say what was the issue). In my free time, I can prepare PR with named parameters for a better understanding of the service. Sorry for the false alarm. |
I tried the following on the CLI (mainly because it's easier to create a cluster) atlas cluster create M10 --provider AWS --region US_EAST_1 --tier M10 --backup
atlas backups schedule describe M10 -o json And the error I get is
And for a cluster that doesn't exists I get
I'm a bit curious because this error in particular
Seems like a deserialization error somewhere and we have some options in the client to customize where deserialization happens instead of a return value. If it works for you now that you wait for the cluster that's great but if it happens again let us know with a way to reproduce which is as close as how you are using the lib so we can discard any internal issue with some of the more advanced settings |
Hi Team!
I'm trying to call Atlas API to GET the backup policy (
CloudProviderSnapshotBackupPoliciesService
) and I'm getting an error from the client:My cluster is running in Atlas, I have enabled continuous backups. I'm passing valid parameters and it seems that issue is not on my service side.
Could someone look at this?
Cheers,
Magda
The text was updated successfully, but these errors were encountered: