-
Notifications
You must be signed in to change notification settings - Fork 6
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
WIP: add support for monthly billing details in excel format #139
base: master
Are you sure you want to change the base?
Conversation
@@ -37,6 +44,21 @@ func newBillingCmd(c *config) *cobra.Command { | |||
Short: "manage bills", | |||
Long: "TODO", | |||
} | |||
excelBillingCmd := &cobra.Command{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be a new output option, e.g. -o xlsx
as for yaml and json.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not really, as it generates ALL available billing data in one excel file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But actually csv creation is done serverside (cloud-api)
@@ -322,6 +352,422 @@ func (c *config) clusterUsageCSV(cur *models.V1ClusterUsageRequest) error { | |||
return nil | |||
} | |||
|
|||
func (c *config) excel() error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be a printer not a command
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could rename this to "all", but I'm not sure how to generate an output for everything in the other formats.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
json and yaml output is simply a serialization, table output is obviously a bit harder, can then be return a error like table output for all entities is not supported
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe even better instead of all
a slice of entities which should be returned, e.g. cloudctl billing cluster,volume -o xlsx
k8s.io/client-go v11.0.1-0.20190409021438-1a26190bd76a+incompatible // indirect | ||
sigs.k8s.io/controller-runtime v0.8.3 // indirect | ||
) | ||
|
||
require ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do not use 2 require stanzas
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for simpler error checking there is a must
func provided
This is currently done on server side and thoroughly tested, having the same logic on the client side without tests is not a good idea an will lead to differences in both results and issues raised by customers. Closing. |
This PR adds a generator for monthly billing details in excel format