-
Notifications
You must be signed in to change notification settings - Fork 3.4k
[Synapse] Add new cmdlets for synapse sql aad admin and sql audit policy and add update cmdlet for synapse workspace firewall rule #16241
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
Changes from 26 commits
00b9235
ab16df0
03436bc
7d98b1f
06f6ec5
adab2d2
c7b9f98
18e8b8d
1eb5074
cc3a159
af8f98e
0f904b9
d17a993
331b406
c98c195
ee648a0
d2faa9f
64d0de4
7b250f5
03c8785
2f814b1
5c00b61
4c49538
fbf2482
44f0481
3f55253
6bcdfcd
8b77b75
8ec6270
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,6 +17,8 @@ def load_command_table(self, _): | |
| from ._client_factory import cf_synapse_client_sqlpool_transparent_data_encryptions_factory | ||
| from ._client_factory import cf_synapse_client_sqlpool_security_alert_policies_factory | ||
| from ._client_factory import cf_synapse_client_sqlpool_blob_auditing_policies_factory | ||
| from ._client_factory import cf_synapse_client_workspace_aad_admins_factory | ||
| from ._client_factory import cf_synapse_client_sqlserver_blob_auditing_policies_factory | ||
|
|
||
| def get_custom_sdk(custom_module, client_factory): | ||
| return CliCommandType( | ||
|
|
@@ -36,6 +38,10 @@ def get_custom_sdk(custom_module, client_factory): | |
| operations_tmpl='azure.mgmt.synapse.operations#BigDataPoolsOperations.{}', | ||
| client_factory=cf_synapse_client_bigdatapool_factory) | ||
|
|
||
| synapse_workspace_aad_admin_sdk = CliCommandType( | ||
| operations_tmpl='azure.mgmt.synapse.operations#WorkspaceAadAdminsOperations.{}' | ||
| ) | ||
|
|
||
| synapse_sqlpool_sdk = CliCommandType( | ||
| operations_tmpl='azure.mgmt.synapse.operations#SqlPoolsOperations.{}', | ||
| client_factory=cf_synapse_client_sqlpool_factory) | ||
|
|
@@ -55,7 +61,7 @@ def get_custom_sdk(custom_module, client_factory): | |
| operations_tmpl='azure.mgmt.synapse.operations#SqlPoolTransparentDataEncryptionsOperations.{}', | ||
| client_factory=cf_synapse_client_sqlpool_transparent_data_encryptions_factory) | ||
|
|
||
| # Threat Policy operation | ||
| # Threat policy operation | ||
| synapse_sqlpool_security_alert_policies_sdk = CliCommandType( | ||
| operations_tmpl='azure.mgmt.synapse.operations#SqlPoolSecurityAlertPoliciesOperations.{}', | ||
| client_factory=cf_synapse_client_sqlpool_security_alert_policies_factory) | ||
|
|
@@ -65,6 +71,11 @@ def get_custom_sdk(custom_module, client_factory): | |
| operations_tmpl='azure.mgmt.synapse.operations#SqlPoolBlobAuditingPoliciesOperations.{}', | ||
| client_factory=cf_synapse_client_sqlpool_blob_auditing_policies_factory) | ||
|
|
||
| # Workspace managed sql server audit policy operation | ||
| synapse_workspace_managed_sqlserver_blob_auditing_policies_sdk = CliCommandType( | ||
| operations_tmpl='azure.mgmt.synapse.operations#WorkspaceManagedSqlServerBlobAuditingPoliciesOperations.{}', | ||
| client_factory=cf_synapse_client_sqlserver_blob_auditing_policies_factory) | ||
|
|
||
| synapse_firewallrules_sdk = CliCommandType( | ||
| operations_tmpl='azure.mgmt.synapse.operations#IpFirewallRulesOperations.{}', | ||
| client_factory=cf_synapse_client_ipfirewallrules_factory) | ||
|
|
@@ -200,13 +211,35 @@ def get_custom_sdk(custom_module, client_factory): | |
| g.show_command('show', 'get') | ||
| g.generic_update_command('update', custom_func_name='sqlpool_blob_auditing_policy_update') | ||
|
|
||
| # Management Plane Commands --Sql Ad-Admin | ||
| with self.command_group('synapse sql ad-admin', command_type=synapse_workspace_aad_admin_sdk, | ||
| custom_command_type=get_custom_sdk('workspacesqlaadadmin', | ||
| cf_synapse_client_workspace_aad_admins_factory), | ||
| client_factory=cf_synapse_client_workspace_aad_admins_factory) as g: | ||
| g.show_command('show', 'get') | ||
| g.custom_command('create', 'create_workspace_sql_aad_admin', supports_no_wait=True) | ||
| g.generic_update_command('update', custom_func_name='update_workspace_sql_aad_admin', | ||
| setter_arg_name='aad_admin_info', supports_no_wait=True) | ||
| g.command('delete', 'delete') | ||
|
Juliehzl marked this conversation as resolved.
Outdated
aim-for-better marked this conversation as resolved.
Outdated
|
||
| g.wait_command('wait') | ||
|
|
||
| # Management Plane Commands --Sql audit-policy | ||
| with self.command_group('synapse sql audit-policy', | ||
| command_type=synapse_workspace_managed_sqlserver_blob_auditing_policies_sdk, | ||
| custom_command_type=get_custom_sdk('sqlpoolblobauditingpolicy', | ||
| cf_synapse_client_sqlserver_blob_auditing_policies_factory), | ||
| client_factory=cf_synapse_client_sqlserver_blob_auditing_policies_factory) as g: | ||
| g.show_command('show', 'get') | ||
| g.generic_update_command('update', custom_func_name='sqlserver_blob_auditing_policy_update') | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. only two commands for audit-policy? What about delete, create, list?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Here we just to keep consistent with |
||
|
|
||
| # Management Plane Commands --FirewallRule | ||
| with self.command_group('synapse workspace firewall-rule', command_type=synapse_firewallrules_sdk, | ||
| custom_command_type=get_custom_sdk('workspace', cf_synapse_client_ipfirewallrules_factory), | ||
| client_factory=cf_synapse_client_ipfirewallrules_factory) as g: | ||
| g.command('list', 'list_by_workspace') | ||
| g.show_command('show', 'get') | ||
| g.custom_command('create', 'create_firewall_rule', supports_no_wait=True) | ||
| g.custom_command('update', 'update_firewall_rule', supports_no_wait=True) | ||
| g.command('delete', 'delete', confirmation=True, supports_no_wait=True) | ||
| g.wait_command('wait') | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.