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

billing breakdown invalid #124

Open
boyangzhao opened this issue Aug 31, 2021 · 6 comments
Open

billing breakdown invalid #124

boyangzhao opened this issue Aug 31, 2021 · 6 comments

Comments

@boyangzhao
Copy link

sevenbridges-python: 2.5.0

I'm using the api to calling the billing group method, but it seems breakdown() is not working (previously it was). Upon calling the breakdown() method, I receive the following error (I replaced actual billing group with <billing group>)

sevenbridges.errors.NotFound: /v2/billing/groups/<billing group>/breakdown not found

@bogdang989
Copy link

Hi @boyangzhao thank you for opening the issue, and apologies for inconvenience. As you noticed, the breakdown() method is not working and will be deprecated very soon in a new release. The billing breakdowns are available in more detail in three new methods for analysis, storage and egress billing breakdowns, e.g. analysis_breakdown(). Hope this information is helpful, I will close this issue, please reopen if needed.

@boyangzhao
Copy link
Author

Thanks - is there an equivalent to get at the total_spending.amount that was previously available in breakdown. The methods (analyses, storage, egress) return arrays and it seems you have to now sum through all the array items and across all the analyses/storage/egress breakdowns to get at the total spending amount.

@bogdang989
Copy link

Hi, you are right for now the only way to get the total is to sum everything up. I will send a ticket internally to see if we can improve this somehow. Thanks again for the feedback.

@boyangzhao
Copy link
Author

Thanks that would be great. Also, while egress and analyses as cost fields, storage does not contain cost fields, so I cannot get the total by simply summing it up. Storage seems to have in units of GB/Month, but based on the https://docs.sevenbridges.com/docs/storage-costs example, it doesn't seem though it is adding up. Can you clarify if the unit is indeed GB/Month, and how do we go from size to storage cost?

@bogdang989
Copy link

Hi @boyangzhao
This is an oversight, and the unit should actually be GB * Month. I added a recipe here with some explanations https://github.com/sbg/okAPI/blob/master/Recipes/SBPLAT/billing_getTotalForPeriod.ipynb that shows example of how to sum up all costs in a project for a particular time frame, including storage costs.

@boyangzhao
Copy link
Author

Thanks - I also saw in the documentations the cost conversions (for example here). But the conversion of $0.023 per (GB * month) doesn't quite match that in billing on SB. For example ~ 61000 GB*Month (the sum through the API) would lead to $1400, but in billing, this corresponds to ~$70. This is off by a pretty big factor. Previously the total_spending.amount matches the total spending under billing on SB.

A side note, it seemed the date_from and date_to follows mm-dd-yyyy and not dd-mm-yyyy format

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

No branches or pull requests

2 participants