-
Notifications
You must be signed in to change notification settings - Fork 21
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
Include complete data in to_dict() methods #111
Comments
Hi there! The functionality is available through the CloudManager with Could you try this out? Happy to help if you run into any problems with it. |
Hi @ajmyyra, when I use {
"tier": "maxiops",
"title": "xxx",
"size": 16,
"zone": "xxx"
} But when I use the documented API via {
"storage": {
"access": "private",
"backup_rule": {},
"backups": {
"backup": []
},
"license": 0,
"servers": {
"server": [
"xxx"
]
},
"size": 16,
"state": "online",
"tier": "maxiops",
"title": "xxx",
"type": "normal",
"uuid": "xxx",
"zone": "xxx"
}
} So it seems like they are not equivalent? |
Hi, As Storage is an object, getting a dict out of it is not that straightforward. Using it on its own should give you a lot more details:
|
Hmm is there a reason that those other fields are left out of the |
Currently to_dict() function in storage objects is used for creating a JSON object that includes the relevant items for the storage objects in the UpCloud server API. If you want your object as a dictionary, can't you just create it from the object with
|
Yes, I could but it seems like it's not very intuitive to have to do that when there's a method called |
Yup, it's hard to disagree with you on this. The only excuse is that it's not documented as it's meant as an internal function. We should change it to work as you would expect but as this would be a breaking change, we'll need to wait for the next larger release to do it. Could you create a separate issue for this change (and adding similar to_dict() functionality to other objects as well) or modify the title of this one, so we can track this change better? |
Sure, I've renamed the title. Let me know if it's a suitable title and thanks! |
It is, thank you! Hopefully we can get back to this in the near future. |
Hi, I couldn't seem to find the Python API for getting storage details which is documented here. Did I overlook it or is it simply not implemented yet?
The text was updated successfully, but these errors were encountered: