This repository has been archived by the owner on Sep 13, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 18
Accept command line flags for setting dates, and ideally tags to filter by #9
Milestone
Comments
After chatting, we'll use meow, instead of commander. Mapbox already use it, and well… better gifs. |
After convo, we're punting the tag decisions till we have first part built, and see how ppl use it. |
This is the API we agreed on
flags
|
At the moment the utility throws an error since the dates that are hard coded request data that's more than 12 months ago, which the API does not support. |
edsu
added a commit
to edsu/green-cost-explorer
that referenced
this issue
Nov 3, 2019
Until thegreenwebfoundation#9 is resolved I thought it would be useful if the tool defaults to the last 12 months of activity instead of having hard coded dates that prevent it from running with an error. I thought this could be useful since people may try out the utility after the recent blog post by Mapbox: https://blog.mapbox.com/how-much-carbon-is-your-server-emitting-d7edf3496fd6
Merged
mrchrisadams
pushed a commit
that referenced
this issue
Nov 4, 2019
Until #9 is resolved I thought it would be useful if the tool defaults to the last 12 months of activity instead of having hard coded dates that prevent it from running with an error. I thought this could be useful since people may try out the utility after the recent blog post by Mapbox: https://blog.mapbox.com/how-much-carbon-is-your-server-emitting-d7edf3496fd6
Thanks for changing the hard coding, @edsu. I based on on the extra bits, I'm going to leave this open in the hope that me, or some kind soul from the internet is able to add the parsing of flags for specific dates 👍 |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Right now the we have hard coded dates for running checks.
There's a normal 1 year rolling window I think for cost explorer, but it would be nice to set the time bounds, like you can with the python cli.
For example, when you have this:
I would be good to do something to either use the same kinds of flags:
Or ideally use flags like so, which
I'm not sure what the convention is for node js, but if we know we only ever have maximum of today plus one year back, we might be able to have some sensible defaults to show the last year of spend analysis, or be able to set arbitrary figures like so:
I'm not sure what the most command CLI tool for node is, but commander looks well documented, and is used by the Vue CLI, so there's code examples we can look to for seeing how different things are implemented
https://www.npmjs.com/package/commander
### Bonus bit
If filtering by tags is simple, then it gives us a nice way to restrict a query to a single project team.
https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_GetCostAndUsage.html#API_GetCostAndUsage_RequestSyntax
The text was updated successfully, but these errors were encountered: