EventGrid CLI extension: Updates to support new preview API version features#331
EventGrid CLI extension: Updates to support new preview API version features#331williexu merged 23 commits intoAzure:masterfrom
Conversation
… create to include advanced filters, expiration date, and eventdeliveryschema changes.
…ing on using --resource-id to specify all types of topics.
… operations as it has been superseded by --source-resource-id.
|
Please pass CI checks |
…ithout actually installing the python-dateutil dependency.
|
@williexu , @tjprescott : I have resolved all the CI check issues, can you please help review this today? Also, since this depends on the Knack fix (0.4.4), should I specify the minimum version of Knack somewhere? |
tjprescott
left a comment
There was a problem hiding this comment.
There's a lot of copy-paste duplication in the params.py file. You should strive to avoid this since it creates a maintenance burden moving forward. You could either:
a) extract the common info to CliArgumentTypes which you can then register at each scope
foo_type = CliArgumentType(…)
with self.argument_context('scope a') as c:
c.argument('foo', foo_type)
with self.argument_context('scope b') as c:
c.argument('foo', foo_type)b) use scope to only need to register the argument once:
for scope in ['scope a', 'scope b']:
with self.argument_context(scope) as c:
c.argument('foo', ...)|
|
||
| with self.argument_context('eventgrid event-subscription create') as c: | ||
| c.argument('source_resource_id', help="Fully qualified identifier of the Azure resource to which the event subscription needs to be created.") | ||
| c.argument('resource_id', deprecate_info=c.deprecate(redirect="--source-resource-id", expiration='2.1.0', hide=True)) |
There was a problem hiding this comment.
It would be good to extract this common info to a CliCommandType so that if you have to change it later, it is changed everywhere.
There was a problem hiding this comment.
Thanks for the feedback, I have updated this now to remove this duplication.
|
@tjprescott is the CLI ready to take a dependency on knack v0.4.4? |
|
@kalyanaj you will need to update your |
|
Thanks for the info and for PR 7567, @williexu. I will update it as you suggested once CLI 2.0.48 gets released, until then leaving it as it is so as to not blocking testing/initial release. |
|
@tjprescott , @williexu : I have made all the changes discussed above. Can you please review/merge if there are no additional feedback items? |
|
@kalyanaj can you actually set the min cli version to |
|
I can merge right after |
Added support for new preview API version (2018-09-15-preview) functionality: Support for domain operations, advanced filters, event subscription expiration. Also, consolidated/simplified existing event subscription CRUD operation parameters to improve usability.
This checklist is used to make sure that common guidelines for a pull request are followed.
General Guidelines
./scripts/ci/test_static.shlocally? (pip install pylint flake8required)python scripts/ci/test_index.py -qlocally?For new extensions: