-
Notifications
You must be signed in to change notification settings - Fork 61
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
result.id of GET accountsettings function of cloudshell is returning nil #159
Comments
@kavya498 Could you please make sure that you are using the latest version of the platform-services-go-sdk, and also ensure that debug logging has been turned on in the go core (I think there is a standard way to do this within the tf environment). In that scenario, you should see request and response messages logged as the various operations are being invoked. That should tell us if the correct info is in fact coming back from the server. Once we verify that it is, we can then make sure that we're unmarshalling it correctly within the SDK code. In the generated service code in the Go SDK, I see this within the func UnmarshalAccountSettings(m map[string]json.RawMessage, result interface{}) (err error) {
obj := new(AccountSettings)
err = core.UnmarshalPrimitive(m, "_id", &obj.ID)
if err != nil {
return
} So, the SDK is certainly TRYING to unmarshal the "_id" field from the response body json string :) |
@kavya498 I ran the Go SDK integration test for the service and here are the debug request/response messages for the GetAccountSettings operation:
And you can see that the |
@hartyt ^^^ |
BTW, it looks like the following fields from the "AccountSettings" schema are missing from the operation's response: |
@padamstx I'm not familiar with the sdk but I tried to do an example: `package main import ( var accountID="681694096ef8338ad439a95a1b897e00" func main() {
}` I get all the values printed out and I get the ID printed. Am I missing something or is this a bug only affecting particular accounts? |
Not sure why the service would behave differently for different accounts, if that is in fact happening. I've contacted the team that supports the service, so hopefully they'll have some answers soon. |
Sorry @padamstx I'm from the team. The issue we are seeing happens only the first time a user access the AccountSettings because there is no database entry created. You should be able to update the settings and in the process all those fields will be created. |
Oh, sorry about that... I had pinged Bo on slack and didn't know that you were working on the cloudshell service :) From a user's standpoint, it seems weird that they would first need to update the account settings before they can retrieve the account settings (and see all the fields filled in) for an existing account. This seems sorta like a bug in the service to me. The GET operation has a certain set of properties defined in the response, and only some of them are getting set. |
@kavya498 Given the above discussion about the current behavior of the GET operation, it seems like that would cause some potential issues in the terraform provider, wouldn't it? I mean... it seems like the terraform provider would be much more straightforward if the GET operation just always returned the values associated with the server-populated properties (e.g. |
That makes sense, I'll put it in the backlog and will try to get to it in the next iteration |
Thanks @seancallanan Could you add a link to the new issue here as well? @kavya498 Once Sean provides the link to the new issue, can we close this out? You could then monitor the other issue for when the service will be updated. Once that change is made, the Go SDK behavior should just change accordingly. |
|
Since this issue will need to be addressed in the cloudshell service implementation, I've cc'd Kavya in the cloudshell issue linked above, and I will close out this one... |
Describe the bug
result.id of GET accountsettings function of cloudshell is returning nil
Expected behavior
It should have returned unique ID
The text was updated successfully, but these errors were encountered: