-
Notifications
You must be signed in to change notification settings - Fork 18
feat(account): add new command to get billing summary #606
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
Conversation
|
Hello and thank you for another pull request! I tried testing this, but got an error: $ upctl account billing --year 2025 --month 11
✗ Command execution failed
Error: json: cannot unmarshal string into Go struct field BillingResourceDetail.servers.server.resources.details.firewall of type float64
Error: Command execution failed for 1 resource(s)I guess that might be a bug on the Go SDK side, though. I'll try to dig the raw response data to see how it looks like 👀 Also got an successful result with earlier month. |
|
Overall, looks good to me, but I would tune the human readable output a bit 👍 |
|
changed the output to table format. Summary:
Resource Amount
────────── ──────────
Networks 0.37625
Storages 2.666
Servers 8.13787
Total 11.18012
Networks - IPv4 Address Resources:
Resource ID Amount Hours
─────────────── ───────── ───────
XX.XXX.XX.X 0.37625 86
Storages - Storage Resources:
Resource ID Amount Hours
────────────────────────────────────── ──────── ───────
XXXX-XXXX-XXXX 2.666 86
Servers - Server Resources:
Resource ID Amount Hours
────────────────────────────────────── ───────── ───────
XXXX-XXXX-XXXX 0.13838 31
XXXX-XXXX-XXXX 7.99949 672 |
|
Thank you for updating the output format and sorry for the delay in reviewing this! I'll try to move this forward during next week. |
Closes UpCloudLtd#339 Co-authored-by: Toni Kangas <toni.kangas@upcloud.com>
Closes #339
Adds a new account billing command to retrieve and display billing information for a specific month and year.
Example usage
./upctl account billing --year 2025 --month 10 Currency: EUR Total Amount: 34.31849 Networks Total Amount: 3.255 IPv4 Address Total: 3.255 Resource 1 ID: xxxx-xxxx-xxxx Resource 1 Amount: 3.255 Resource 1 Hours: 744 Storages Total Amount: 23.064 Storage Total: 23.064 Resource 1 ID: xxxx-xxxx-xxxx Resource 1 Amount: 23.064 Resource 1 Hours: 744 Servers Total Amount: 7.99949 Server Total: 7.99949 Resource 1 ID: xxxx-xxxx-xxxx Resource 1 Amount: 7.99949 Resource 1 Hours: 672