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

Add support for monthly billing summary API #2

Open
vmj opened this issue Feb 24, 2020 · 3 comments
Open

Add support for monthly billing summary API #2

vmj opened this issue Feb 24, 2020 · 3 comments
Milestone

Comments

@vmj
Copy link
Owner

vmj commented Feb 24, 2020

There are two new APIs:

  • GET /1.3/account/billing_summary/YYYY-MM
  • GET /1.3/account/billing_summary/YYYY-MM/detailed

See if they require one or two methods in UpCloudApi trait.

Also, check how they parse and if they conflict with any of the resources.

https://developers.upcloud.com/1.3/3-accounts/#get-monthly-billing-summary

https://developers.upcloud.com/1.3/3-accounts/#get-detailed-monthly-billing-summary

This is separate from #3 but the implied (new) Billing resource will be a mess.

@vmj vmj added the api-1.3 Needed to fully support UpCloud API 1.3 label Feb 24, 2020
@vmj
Copy link
Owner Author

vmj commented Mar 4, 2020

These seem to be available in 1.2 API, too.

@vmj vmj removed the api-1.3 Needed to fully support UpCloud API 1.3 label Mar 4, 2020
@vmj
Copy link
Owner Author

vmj commented Mar 4, 2020

The monthly billing summary response has the following structure:

  • Billing (new resource)
    • currency: String
    • totalAmount: BigDecimal
    • servers: Servers (new resource)
      • totalAmount: BigDecimal
      • server: Server
        • totalAmount: BigDecimal (new property in Server)
    • storages: Storages (new resource)
      • totalAmount: BigDecimal
      • storage: Storage
        • totalAmount: BigDecimal (new property in Storage)

Zero amounts are not returned. Will need to add the network support when working with the networks in #6

@vmj
Copy link
Owner Author

vmj commented Mar 4, 2020

The detailed monthly summary response has the following structure:

  • Billing (new resource)
    • currency: String
    • totalAmount: BigDecimal
    • servers: Servers (new resource)
      • totalAmount: BigDecimal
      • server: Server
        • totalAmount: BigDecimal (new property in Server)
        • resources: List<Resources> (new property in Server, new resource)
          • resourceId: String
          • amount: BigDecimal
          • hours: Integer
          • firewall: String
          • plan: String
    • storages: Storages (new resource)
      • totalAmount: BigDecimal
      • storage: Storage
        • totalAmount: BigDecimal (new property in Storage)
        • resources: List<Resources> (new property in Storage, new resource)
          • resourceId: String
          • amount: BigDecimal
          • hours: Integer
          • size: Integer

The response does not adhere to the "list wrapper" convention. Hence "resources" ends up being whatever List of Maps -type the JSON implementation generates. This needs support.

@vmj vmj added this to the 0.0.8 milestone Apr 8, 2020
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

1 participant