.../services/recoveryservices/mgmt/2020-02-02/backupmastergo version go1.13.4 linux/amd64If I try to list or get a Recovery Point I get and Unmarshalling Error. One example SDK call could be:
rpClient := backup.NewRecoveryPointsClient(sess.SubscriptionID)
...
rpList, err := rpClient.List(...)
The error produced by the previous code is:
2020/07/30 09:52:04 backup.RecoveryPointsClient#List: Failure responding to request: StatusCode=200 -- Original Error: Error occurred unmarshalling JSON - Error = 'json: cannot unmarshal number into Go struct field RecoveryPointResourceList.value of type backup.RecoveryPointTierType'
Taking a further look I saw that there is an inconsistency between what the Go SDK expects and what the GET call returns, as the http request returns an integer and the SDK expects a string for the RecoveryPointTierType value. Example output:
..."recoveryPointTierDetails":[{"type":1,"status":1},{"type":2,"status":1}],...
For the field type the sdk expects a string => SDK code
Is is an API version problem?
Hi @rogercoll thanks for this issue!
This should be a swagger issue - the swagger definition is not consistent with what the API returns.
I have tagged this issue so that the corresponding service team will have a look at this.
Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @pvrk.
"This should be a swagger issue - the swagger definition is not consistent with what the API returns."
@ArcturusZhang : Thanks for helping to narrow down the probable root cause.
Forwarding this to my service team for investigation.
@pratimaupadhyay02: Can you please take a look at this issue?
Hello, thank you very much for your responses. Is there any update regarding this issue? My team and I are working on a tool to automated recovery services backup restoration and this issue stop us to move on.
@pvrk @ArcturusZhang is there any update regarding the issue error?
Hi @rogercoll Sorry for the delayed response. The issue seems specific to Go-SDK so we have to loop in the go-sdk team for some expertise.
Hi @pratimaupadhyay02 based on the swagger definition here, this property is meant to be not only a string, but an enum value among Invalid, InstantRP and HardenedRP. Therefore this issue is apparently caused by either something wrong in the swagger or some behaviour issue in the service itself. Please double check, thanks
We are working on the fix and will update the ETA soon. This might be fixed from a new API version to make sure older APIs are not broken if they took a dependency on existing behavior.
Hi, Is there an update on this? or even some workaround to get the recovery points?
Thanks
@cohenjo We will get back on this by end of this month
@cohenjo the latest version of the API has the fix for this. Can you please try hitting the API directly? Ideally any API version post 2020-10-01 should work.
@cohenjo the latest version of the API has the fix for this. Can you please try hitting the API directly? Ideally any API version post 2020-10-01 should work.
Also could you please open a SDK release request to either refresh the existing SDK package or introduce a new package corresponding to the new api-version so that we could unblock the customers of azure-sdk-for-go?
You can submit a release request here