Skip to content
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

Support getting billing summary #339

Open
luopio opened this issue Nov 7, 2024 · 1 comment
Open

Support getting billing summary #339

luopio opened this issue Nov 7, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@luopio
Copy link

luopio commented Nov 7, 2024

One of our UC accounts contains several client apps and I'd like to see how much each of these cost us. Right now the UI under "Billing" is pretty difficult as it will either give me a log of incurred costs or summaries of monthly costs grouped by product and only containing the UUID of the product.

To calculate how much client A is costing us, I have to manually check the client's used product UUIDs and find them from the Billing > Monthly view to have any idea of how much something is setting me back. Then I need to sum up those costs.

Describe the solution you'd like
If I could get the same kind of list via upctl as what I get on the web, I could at least script it and match the rows with a collected list of UUIDs for that client. Even better if it could search all products and filter on request. E.g.

upctl billing --year 2024 --month 1 --all

Could list something like

RESOURCE    UUID                                                                    PLAN                               TIME       COST
Server            0039ca87-7c47-42dc-8edb-b4aeee91e887   6xCPU-16GB                  28 days  €120.00
Database      09533fd1-da18-4bc1-8f12-03a2b19f32e7     2x2xCPU-4GB-50GB     31 days  €103.33
[...]

Then you could do upctl billing --month 1 --year 2024 --resource server or even upctl billing --month 1 --year 2024 --match-name acme to look for each resource that has a name that contains "acme".

Describe alternatives you've considered
I've considered scraping your costs page, forming a lookup table and then listing our resources to match and calculate an estimate of billing, but that's a few hacks too many.

Additional context
TBH this is to overcome the shortcomings of the Billing views on the web-ui, but I do think it would benefit the command line client in other use cases as well.

Althought most of your clients are probably just paying attention to the grand total, this would benefit also cases where you want to know how much your staging environment is costing you out of the total.

@luopio luopio added the enhancement New feature or request label Nov 7, 2024
@kangasta
Copy link
Contributor

kangasta commented Nov 13, 2024

Thanks for the feature request! We'll look into how this could be supported in the CLI.

In the mean time, curl against our API (e.g. detailed summary or per resource summary) and jq for parsing the response JSON might also work 🤔 For example:

curl -u $UPCLOUD_USERNAME:$UPCLOUD_PASSWORD https://api.upcloud.com/1.3/account/billing_summary/2024-10/detailed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants