Conversation
|
Is the linter rule "MEDIUM severity: no_required_location_param" new added? |
9e2977b to
492737a
Compare
| def _validate_audit_policy_arguments(state=None, storage_account=None, storage_endpoint=None, | ||
| storage_account_access_key=None, retention_days=None): | ||
| blob_storage_arguments_provided = any( | ||
| [storage_account, storage_endpoint, storage_account_access_key, retention_days]) | ||
| if not state and not blob_storage_arguments_provided: | ||
| raise CLIError('Either state or blob storage arguments are missing') | ||
|
|
||
| if retention_days is not None and (not retention_days.isdigit() or int(retention_days) <= 0): | ||
| raise CLIError('retention-days must be a positive number greater than zero') |
There was a problem hiding this comment.
such validation would be recommended to add as validator and other commands/parameters could utilize the function.
see https://github.com/Azure/azure-cli/blob/dev/src/azure-cli/azure/cli/command_modules/storage/_params.py#L351
There was a problem hiding this comment.
such validation would be recommended to add as validator and other commands/parameters could utilize the function.
see https://github.com/Azure/azure-cli/blob/dev/src/azure-cli/azure/cli/command_modules/storage/_params.py#L351
Hi @Juliehzl , thanks for your comment, I have removed the validation for retention_days. I agree with you, but per my understanding, the validator need to bind with one parameter which means one validator for one parameter, how should we validate multiple parameters in validator?
There was a problem hiding this comment.
Hi @Juliehzl , for this comments, could you please give some suggestions? Thanks
There was a problem hiding this comment.
I have moved this function to _validators.py and add validator in command level. Thanks for this comments, it is my first time to know that we can add validator in command level.
src/azure-cli/azure/cli/command_modules/synapse/operations/workspace.py
Outdated
Show resolved
Hide resolved
899623b to
7ccb153
Compare
7ccb153 to
3f55253
Compare
…group function in _client_factory.py
|
/azp run |
|
Azure Pipelines successfully started running 2 pipeline(s). |
|
Hi @jsntcy Could you please help review this PR? It is almost 5 work days. We hope we can catch S180. Thank you very much~ |
|
/azp run |
|
Azure Pipelines successfully started running 2 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 2 pipeline(s). |
| g.show_command('show', 'get') | ||
| g.generic_update_command('update', custom_func_name='sqlserver_blob_auditing_policy_update') |
There was a problem hiding this comment.
only two commands for audit-policy? What about delete, create, list?
There was a problem hiding this comment.
Here we just to keep consistent with az sql server. And I checked for az synapse sql audit-policy the dependent api is a long running, but for az synapse sql pool audit-policy the dependent api is not long running.
I have add wait command and add suppport_no_wait=True for this comments.
| self.cmd('az synapse sql audit-policy update --state Enabled --storage-account {storage-account} ' | ||
| '--workspace-name {workspace} --resource-group {rg}') | ||
|
|
||
| self.cmd('az synapse sql audit-policy show --workspace-name {workspace} --resource-group {rg}', | ||
| checks=[ | ||
| self.check('state', 'Enabled') | ||
| ]) |
There was a problem hiding this comment.
- could we also check the update command?
- could we get first, update and then get again to see the value change?
- please add update for all parameters.
There was a problem hiding this comment.
- could we also check the update command?
- could we get first, update and then get again to see the value change?
- please add update for all parameters.
Thanks, I have updated the test for az synapse sql audit-policy and az synapse sql pool audit-policy
src/azure-cli/azure/cli/command_modules/synapse/tests/latest/test_synapse_scenario.py
Show resolved
Hide resolved
src/azure-cli/azure/cli/command_modules/synapse/tests/latest/test_synapse_scenario.py
Show resolved
Hide resolved
|
Please address the comments raised by @Juliehzl before merging this PR. |
Sure. Thanks |
Description
Testing Guide
History Notes
[Synapse] 1. Add new cmdlets az synapse sql ad-admin show, create, update, delete
2. Add new cmdlet az synapse workspace firewall-rule update
3. Add new cmdlets az synapse sql audit-policy show, update
This checklist is used to make sure that common guidelines for a pull request are followed.
The PR title and description has followed the guideline in Submitting Pull Requests.
I adhere to the Command Guidelines.
I adhere to the Error Handling Guidelines.