Changing CLI for azure-consumption reflecting the new api-version#4900
Changing CLI for azure-consumption reflecting the new api-version#4900derekbekoe merged 3 commits intoAzure:devfrom
Conversation
|
View a preview at https://prompt.ws/r/Azure/azure-cli/4900 |
|
@derekbekoe & @lmazuel Please review |
derekbekoe
left a comment
There was a problem hiding this comment.
Looks good overall.
Left a few comments.
| =============== | ||
|
|
||
| 0.2.0 | ||
| ++++++++++ |
There was a problem hiding this comment.
Heading length is too long. It should match the no. of characters in the heading.
CI may fail due to this.
|
|
||
| 0.2.0 | ||
| ++++++++++ | ||
| Release of new GA api version 2017-11-30. |
There was a problem hiding this comment.
Should start with * so it's an actual bullet point list.
| register_cli_argument('consumption usage list', 'start_date', options_list=('--start-date', '-s'), type=get_datetime_type(), help='start date (in UTC Y-m-d) of the usages') | ||
| register_cli_argument('consumption usage list', 'end_date', options_list=('--end-date', '-e'), type=get_datetime_type(), help='end date (in UTC Y-m-d) of the usages') | ||
| register_cli_argument('consumption usage list', 'invoice_name', options_list=('--invoice-name', '-i'), help='name of a specific invoice to get the usage details that associate with') | ||
| register_cli_argument('consumption usage list', 'start_date', options_list=('--start-date', '-s'), type=get_datetime_type(), help='start date (in UTC Y-m-d) of the usages. Both start date and end date need to be supplied or neither ') |
There was a problem hiding this comment.
nit: Remove the extra space at the end of the help text.
|
|
||
| return list(client.list(scope, expand=expand, filter=filter_expression, top=top)) | ||
| if (start_date and not end_date) or (end_date and not start_date): | ||
| raise ValueError("Usage : [--start-date <startDate> & --end-date <endDate>].") |
There was a problem hiding this comment.
This should be done at the validator stage like this:
"usage error: Both --start-date and --end-date need to be supplied or neither."
https://github.com/Azure/azure-cli/blob/dev/src/command_modules/azure-cli-extension/azure/cli/command_modules/extension/_params.py#L23
There was a problem hiding this comment.
Sure, but that example didnt help me on how I can put a validator spanning two arguments. I will sync with you offline for this
|
Thanks @derekbekoe for merging. How can we get this tagged to be released for the Dec 4th release of CLI? |
|
Everything in dev branch is automatically included in each release so you should be good! |
* sp reset-credentials from dev * rebase polish rbac error message * rebase role assignment list: show default assignments for classic administrators * Modified AzureUSGov Endpoint to .US (#4877) * Modified AzureUSGov Endpoint to .US * Updated History.RST to include USGovAADEndPoint Change * Updated Setup.py to match HISTORY.RST * Reduced previous change in HISTORY.RST to a single line * HISTORY.rst merge with latest commit * HISTORY.RST Syntax Correction * webapp/functionapp: ensure list/show display correct set of apps (#4891) * Fix authoring doc typo (#4903) * Changing CLI for azure-consumption reflecting the new api-version (#4900) * Changing CLI for azure-consumption reflecting the new api-version * Modifying Setup.py and history.rst * Implementing review comments * Rebase remove component module * [acr] typo fix in help (#4904) * [acr] typo fix in help * [acr] bump version and add history line item * Rebase of support raw format on resource show * Web: add node appsetting when runtime is not specified (#4907) * webapp: fix a bug in the cert name generation (#4909) * Fix container module default ports (#4950) * fix default ports * bump up version * update history * Advisor command module (#4898) * Initial change to add Advisor module. * Add list recommendations command. * More commands. * More commands. * Pylint fixes and adding a test. * More updates. * More updates. * Fixing precheck errors. * Fixing more precheck errors. * Initial change to add Advisor module. * Add list recommendations command. * More commands. * More commands. * Pylint fixes and adding a test. * More updates. * More updates. * Fixing precheck errors. * Fixing more precheck errors. * Adding missing manifest. * Fixes for test failures. * Addressing review comments and add unit tests. * More fixes. * Address CI failures. * Extra space. * One more fix. * rebase sql usage commands. * Add advisor to default install (#4956) * Add consumption module to code owners (#4906) * Added sql server conn-policy show/update commands (#4888) * Update proj file
This checklist is used to make sure that common guidelines for a pull request are followed.
General Guidelines
Command Guidelines
(see Authoring Command Modules)