1# -------------------------------------------------------------------------------------------- 2# Copyright (c) Microsoft Corporation. All rights reserved. 3# Licensed under the MIT License. See License.txt in the project root for license information. 4# -------------------------------------------------------------------------------------------- 5# pylint: disable=too-many-statements, line-too-long, too-many-branches 6from knack.arguments import CLIArgumentType 7from argcomplete import FilesCompleter 8from azure.mgmt.synapse.models import TransparentDataEncryptionStatus, SecurityAlertPolicyState, BlobAuditingPolicyState 9from azure.cli.core.commands.parameters import name_type, tags_type, get_three_state_flag, get_enum_type, \ 10 get_resource_name_completion_list, get_location_type, file_type 11from azure.cli.core.commands.validators import get_default_location_from_resource_group 12from azure.cli.core.util import get_json_object, shell_safe_json_parse 13from ._validators import validate_storage_account, validate_statement_language, add_progress_callback, validate_repository_type 14from ._completers import get_role_definition_name_completion_list 15from .constant import SparkBatchLanguage, SparkStatementLanguage, SqlPoolConnectionClientType, PrincipalType, \ 16 SqlPoolConnectionClientAuthenticationType, ItemType 17from .action import AddFilters, AddOrderBy 18from shlex import split 19 20workspace_name_arg_type = CLIArgumentType(help='The workspace name.', 21 completer=get_resource_name_completion_list('Microsoft.Synapse/workspaces')) 22assignee_arg_type = CLIArgumentType( 23 help='Represent a user or service principal. Supported format: object id, user sign-in name, or service principal name.') 24 25assignee_object_id_arg_type = CLIArgumentType( 26 help="Use this parameter instead of '--assignee' to bypass Graph API invocation in case of insufficient privileges. " 27 "This parameter only works with object ids for users, groups, service principals, and " 28 "managed identities. For managed identities use the principal id. For service principals, " 29 "use the object id and not the app id.") 30 31role_arg_type = CLIArgumentType(help='The role name/id that is assigned to the principal.', 32 completer=get_role_definition_name_completion_list) 33definition_file_arg_type = CLIArgumentType(options_list=['--file'], completer=FilesCompleter(), 34 type=shell_safe_json_parse, 35 help='Properties may be supplied from a JSON file using the `@{path}` syntax or a JSON string.') 36progress_type = CLIArgumentType(help='Include this flag to disable progress reporting for the command.', 37 action='store_true', validator=add_progress_callback) 38time_format_help = 'Time should be in following format: "YYYY-MM-DDTHH:MM:SS".' 39 40storage_arg_group = "Storage" 41log_analytics_arg_group = "Log Analytics" 42event_hub_arg_group = "Event Hub" 43 44 45def _configure_security_policy_storage_params(arg_ctx): 46 arg_ctx.argument('storage_account', 47 options_list=['--storage-account'], 48 arg_group=storage_arg_group, 49 help='Name of the storage account.') 50 51 arg_ctx.argument('storage_account_access_key', 52 options_list=['--storage-key'], 53 arg_group=storage_arg_group, 54 help='Access key for the storage account.') 55 56 arg_ctx.argument('storage_endpoint', 57 arg_group=storage_arg_group, 58 help='The storage account endpoint.') 59 60 61def _configure_security_or_audit_policy_storage_params(arg_ctx): 62 arg_ctx.argument('storage_account', 63 options_list=['--storage-account'], 64 arg_group=storage_arg_group, 65 help='Name of the storage account.') 66 67 arg_ctx.argument('storage_account_access_key', 68 options_list=['--storage-key'], 69 arg_group=storage_arg_group, 70 help='Access key for the storage account.') 71 72 arg_ctx.argument('storage_endpoint', 73 arg_group=storage_arg_group, 74 help='The storage account endpoint.') 75 76 77def load_arguments(self, _): 78 # synapse workspace 79 for scope in ['show', 'create', 'update', 'delete']: 80 with self.argument_context('synapse workspace ' + scope) as c: 81 c.argument('workspace_name', arg_type=name_type, id_part='name', help='The workspace name.') 82 83 for scope in ['create', 'update']: 84 with self.argument_context('synapse workspace ' + scope) as c: 85 repository_arg_group = 'Git Configuration' 86 c.argument('sql_admin_login_password', options_list=['--sql-admin-login-password', '-p'], 87 help='The sql administrator login password.') 88 c.argument('tags', arg_type=tags_type) 89 c.argument('allowed_aad_tenant_ids', options_list=['--allowed-tenant-ids'], nargs='+', help="The approved Azure AD tenants which outbound data traffic allowed to. The Azure AD tenant of the current user will be included by default. Use ""(\'""\' in PowerShell) to disable all allowed tenant ids.") 90 c.argument('key_name', help='The workspace customer-managed key display name. All existing keys can be found using "az synapse workspace key list" cmdlet.') 91 c.argument('repository_type', arg_group=repository_arg_group, arg_type=get_enum_type(['AzureDevOpsGit', 'GitHub']), validator=validate_repository_type, help='The repository configuration type.') 92 c.argument('host_name', arg_group=repository_arg_group, help='If using github Enterprise Server, provide sever URL like https://github.mydomain.com.Do not use this option with GitHub Enterprise Cloud.') 93 c.argument('account_name', arg_group=repository_arg_group, help='GitHub account name used for the repository or Azure devops organization name') 94 c.argument('collaboration_branch', arg_group=repository_arg_group, help='The branch name where you will collaborate with others and from which you will publish.') 95 c.argument('repository_name', arg_group=repository_arg_group, help='The name of the repository to which you are connecting.') 96 c.argument('root_folder', arg_group=repository_arg_group, help='The name of the folder to the location of your Azure synapse JSON resources are imported. Default is /') 97 c.argument('project_name', arg_group=repository_arg_group, help='The project name to which you are connecting.') 98 c.argument('tenant_id', arg_group=repository_arg_group, help='The tenant id used to connect Azure devops') 99 100 with self.argument_context('synapse workspace create') as c: 101 c.argument('location', get_location_type(self.cli_ctx), validator=get_default_location_from_resource_group) 102 c.argument("storage_account", validator=validate_storage_account, 103 help='The data lake storage account name or resource id.') 104 c.argument('file_system', help='The file system of the data lake storage account.') 105 c.argument('sql_admin_login_user', options_list=['--sql-admin-login-user', '-u'], 106 help='The sql administrator login user name.') 107 c.argument('enable_managed_virtual_network', options_list=['--enable-managed-vnet', 108 '--enable-managed-virtual-network'], 109 arg_type=get_three_state_flag(), 110 help='The flag indicates whether enable managed virtual network.') 111 c.argument('prevent_data_exfiltration', arg_type=get_three_state_flag(), 112 help='The flag indicates whether enable data exfiltration.', options_list=['--prevent-exfiltration', '--prevent-data-exfiltration']) 113 c.argument('key_identifier', help='The customer-managed key used to encrypt all data at rest in the workspace. Key identifier should be in the format of: https://{keyvaultname}.vault.azure.net/keys/{keyname}.', options_list=['--key-identifier', '--cmk']) 114 115 with self.argument_context('synapse workspace check-name') as c: 116 c.argument('name', arg_type=name_type, help='The name you wanted to check.') 117 118 with self.argument_context('synapse workspace activate') as c: 119 c.argument('workspace_name', id_part='name', help='The workspace name.') 120 c.argument('key_identifier', help='The Key Vault Url of the workspace encryption key. should be in the format of: https://{keyvaultname}.vault.azure.net/keys/{keyname}.') 121 c.argument('key_name', arg_type=name_type, id_part='child_name_1', help='The workspace customer-managed key display name. All existing keys can be found using /"az synapse workspace key list/" cmdlet.') 122 # synapse spark pool 123 with self.argument_context('synapse spark pool') as c: 124 c.argument('workspace_name', id_part='name', help='The workspace name.') 125 126 with self.argument_context('synapse spark pool list') as c: 127 c.argument('workspace_name', id_part=None, help='The workspace name.') 128 129 for scope in ['show', 'create', 'update', 'delete']: 130 with self.argument_context('synapse spark pool ' + scope) as c: 131 c.argument('spark_pool_name', arg_type=name_type, id_part='child_name_1', 132 help='The name of the Spark pool.') 133 134 with self.argument_context('synapse spark pool create') as c: 135 # Node 136 c.argument('node_count', type=int, arg_group='Node', help='The number of node.') 137 c.argument('node_size_family', arg_group='Node', help='The node size family.') 138 c.argument('node_size', arg_group='Node', arg_type=get_enum_type(['Small', 'Medium', 'Large']), 139 help='The node size.') 140 141 # AutoScale 142 c.argument('enable_auto_scale', arg_type=get_three_state_flag(), arg_group='AutoScale', 143 help='The flag of enabling auto scale.') 144 c.argument('max_node_count', type=int, arg_group='AutoScale', help='The max node count.') 145 c.argument('min_node_count', type=int, arg_group='AutoScale', help='The min node count.') 146 147 # AutoPause 148 c.argument('enable_auto_pause', arg_type=get_three_state_flag(), arg_group='AutoPause', 149 help='The flag of enabling auto pause.') 150 c.argument('delay', arg_group='AutoPause', help='The delay time whose unit is minute.') 151 152 # Default Folder 153 c.argument('spark_events_folder', arg_group='Default Folder', help='The Spark events folder.') 154 c.argument('spark_log_folder', arg_group='Default Folder', help='The default Spark log folder.') 155 156 # Component Version 157 c.argument('spark_version', arg_group='Component Version', help='The supported Spark version is 2.4 now.') 158 159 c.argument('tags', arg_type=tags_type) 160 161 with self.argument_context('synapse spark pool update') as c: 162 c.argument('tags', arg_type=tags_type) 163 # Node 164 c.argument('node_count', type=int, arg_group='Node', help='The number of node.') 165 c.argument('node_size_family', arg_group='Node', help='The node size family.') 166 167 c.argument('node_size', arg_group='Node', arg_type=get_enum_type(['Small', 'Medium', 'Large']), 168 help='The node size.') 169 # AutoScale 170 c.argument('enable_auto_scale', arg_type=get_three_state_flag(), arg_group='AutoScale', 171 help='The flag of enabling auto scale.') 172 c.argument('max_node_count', type=int, arg_group='AutoScale', help='The max node count.') 173 c.argument('min_node_count', type=int, arg_group='AutoScale', help='The min node count.') 174 175 # AutoPause 176 c.argument('enable_auto_pause', arg_type=get_three_state_flag(), arg_group='AutoPause', 177 help='The flag of enabling auto pause.') 178 c.argument('delay', arg_group='AutoPause', help='The delay time whose unit is minute.') 179 180 # Environment Configuration 181 c.argument('library_requirements', arg_group='Environment Configuration', 182 help='The library requirements file.') 183 c.argument('force', arg_type=get_three_state_flag(), help='The flag of force operation.') 184 185 # Custom Libraries 186 c.argument('package_action', arg_group='Custom Libraries', arg_type=get_enum_type(['Add', 'Remove']), 187 help='Package action must be specified when you add or remove a workspace package from a Apache Spark pool.') 188 c.argument('package', arg_group='Custom Libraries', nargs='+', help='List of workspace packages name.') 189 190 # synapse sql pool 191 with self.argument_context('synapse sql pool') as c: 192 c.argument('workspace_name', id_part='name', help='The workspace name.') 193 194 with self.argument_context('synapse sql pool list') as c: 195 c.argument('workspace_name', id_part=None, help='The workspace name.') 196 197 with self.argument_context('synapse sql pool list-deleted') as c: 198 c.argument('workspace_name', id_part=None, help='The workspace name.') 199 200 for scope in ['show', 'create', 'delete', 'update', 'pause', 'resume', 'restore', 'show-connection-string']: 201 with self.argument_context('synapse sql pool ' + scope) as c: 202 c.argument('sql_pool_name', arg_type=name_type, id_part='child_name_1', help='The SQL pool name.') 203 204 with self.argument_context('synapse sql pool create') as c: 205 c.argument('performance_level', help='The performance level.') 206 c.argument('source_database_id', help='The source database id.') 207 c.argument('recoverable_database_id', help='The recoverable database id.') 208 c.argument('tags', arg_type=tags_type) 209 210 with self.argument_context('synapse sql pool update') as c: 211 c.argument('sku_name', options_list=['--performance-level'], help='The performance level.') 212 c.argument('tags', arg_type=tags_type) 213 214 with self.argument_context('synapse sql pool restore') as c: 215 c.argument('performance_level', help='The performance level.') 216 c.argument('destination_name', options_list=['--dest-name', '--destination-name'], 217 help='Name of the sql pool that will be created as the restore destination.') 218 219 restore_point_arg_group = 'Restore Point' 220 c.argument('restore_point_in_time', 221 options_list=['--time', '-t'], 222 arg_group=restore_point_arg_group, 223 help='The point in time of the source database that will be restored to create the new database. Must be greater than or equal to the source database\'s earliestRestoreDate value. Either --time or --deleted-time (or both) must be specified. {0}'.format( 224 time_format_help)) 225 c.argument('source_database_deletion_date', 226 options_list=['--deleted-time'], 227 arg_group=restore_point_arg_group, 228 help='If specified, restore from a deleted database instead of from an existing database. Must match the deleted time of a deleted database in the same server. Either --time or --deleted-time (or both) must be specified. {0}'.format( 229 time_format_help)) 230 231 with self.argument_context('synapse sql pool show-connection-string') as c: 232 c.argument('client_provider', 233 options_list=['--client', '-c'], 234 help='Type of client connection provider.', 235 arg_type=get_enum_type(SqlPoolConnectionClientType)) 236 237 auth_group = 'Authentication' 238 c.argument('auth_type', 239 options_list=['--auth-type', '-a'], 240 arg_group=auth_group, 241 help='Type of authentication.', 242 arg_type=get_enum_type(SqlPoolConnectionClientAuthenticationType)) 243 244 # synapse sql pool classification 245 with self.argument_context('synapse sql pool classification') as c: 246 c.argument('sql_pool_name', arg_type=name_type, id_part='child_name_1', help='The SQL pool name.') 247 248 with self.argument_context('synapse sql pool classification list') as c: 249 c.argument('workspace_name', id_part=None, help='The workspace name.') 250 251 with self.argument_context('synapse sql pool classification recommendation list') as c: 252 c.argument('workspace_name', id_part=None, help='The workspace name.') 253 c.argument('include_disabled_recommendations', options_list=['--included-disabled'], 254 arg_type=get_three_state_flag(), 255 help='Indicates whether the result should include disabled recommendations') 256 257 for scope in ['show', 'create', 'update', 'delete', 'recommendation enable', 'recommendation disable']: 258 with self.argument_context('synapse sql pool classification ' + scope) as c: 259 c.argument('schema_name', help='The name of schema.', options_list=['--schema']) 260 c.argument('table_name', help='The name of table.', options_list=['--table']) 261 c.argument('column_name', help='The name of column.', options_list=['--column']) 262 c.argument('information_type', help='The information type.') 263 c.argument('label_name', help='The label name.', options_list=['--label']) 264 265 # synapse sql pool tde 266 with self.argument_context('synapse sql pool tde') as c: 267 c.argument('sql_pool_name', arg_type=name_type, id_part='child_name_1', help='The SQL pool name.') 268 c.argument('status', arg_type=get_enum_type(TransparentDataEncryptionStatus), 269 required=True, help='Status of the transparent data encryption.') 270 c.argument('transparent_data_encryption_name', options_list=['--transparent-data-encryption-name', '-d'], help='Name of the transparent data encryption.') 271 272 # synapse sql pool threat-policy 273 with self.argument_context('synapse sql pool threat-policy') as c: 274 c.argument('sql_pool_name', arg_type=name_type, id_part='child_name_1', help='The SQL pool name.') 275 c.argument('security_alert_policy_name', options_list=['--security-alert-policy-name', '-s'], 276 help='Name of the security alert policy.') 277 278 with self.argument_context('synapse sql pool threat-policy update') as c: 279 _configure_security_or_audit_policy_storage_params(c) 280 notification_arg_group = 'Notification' 281 policy_arg_group = 'Policy' 282 283 c.argument('state', 284 arg_group=policy_arg_group, 285 help='Threat detection policy state', 286 arg_type=get_enum_type(SecurityAlertPolicyState)) 287 c.argument('retention_days', 288 type=int, 289 arg_group=policy_arg_group, 290 help='The number of days to retain threat detection logs.') 291 c.argument('disabled_alerts', 292 arg_group=policy_arg_group, 293 help='List of disabled alerts.', 294 nargs='+') 295 c.argument('email_addresses', 296 arg_group=notification_arg_group, 297 help='List of email addresses that alerts are sent to.', 298 nargs='+') 299 c.argument('email_account_admins', 300 arg_group=notification_arg_group, 301 help='Whether the alert is sent to the account administrators.', 302 arg_type=get_three_state_flag()) 303 304 # synapse sql pool audit-policy 305 with self.argument_context('synapse sql pool audit-policy') as c: 306 c.argument('blob_auditing_policy_name', options_list=['--blob-auditing-policy-name', '-b'], 307 help='Name of the blob auditing policy name.') 308 309 with self.argument_context('synapse sql pool audit-policy show') as c: 310 c.argument('blob_auditing_policy_name', options_list=['--blob-auditing-policy-name', '-b'], 311 help='Name of the blob auditing policy name.') 312 c.argument('sql_pool_name', arg_type=name_type, id_part='child_name_1', help='The SQL pool name.') 313 314 with self.argument_context('synapse sql pool audit-policy update') as c: 315 c.argument('blob_auditing_policy_name', options_list=['--blob-auditing-policy-name', '-b'], 316 help='Name of the blob auditing policy name.') 317 c.argument('sql_pool_name', arg_type=name_type, id_part='child_name_1', help='The SQL pool name.') 318 319 for scope in ['synapse sql pool audit-policy', 'synapse sql audit-policy']: 320 with self.argument_context(scope + ' update') as c: 321 _configure_security_or_audit_policy_storage_params(c) 322 323 policy_arg_group = 'Policy' 324 325 c.argument('storage_account_subscription_id', arg_group=storage_arg_group, 326 options_list=['--storage-subscription'], 327 help='The subscription id of storage account') 328 c.argument('is_storage_secondary_key_in_use', arg_group=storage_arg_group, 329 arg_type=get_three_state_flag(), options_list=['--use-secondary-key'], 330 help='Indicates whether using the secondary storeage key or not') 331 c.argument('is_azure_monitor_target_enabled', options_list=['--enable-azure-monitor'], 332 help='Whether enabling azure monitor target or not.', 333 arg_type=get_three_state_flag()) 334 c.argument('state', 335 arg_group=policy_arg_group, 336 help='Auditing policy state', 337 arg_type=get_enum_type(BlobAuditingPolicyState)) 338 c.argument('audit_actions_and_groups', 339 options_list=['--actions'], 340 arg_group=policy_arg_group, 341 help='List of actions and action groups to audit.', 342 nargs='+') 343 c.argument('retention_days', 344 type=int, 345 arg_group=policy_arg_group, 346 help='The number of days to retain audit logs.') 347 c.argument('blob_storage_target_state', 348 arg_group=storage_arg_group, 349 options_list=['--blob-storage-target-state', '--bsts'], 350 configured_default='sql-server', 351 help='Indicate whether blob storage is a destination for audit records.', 352 arg_type=get_enum_type(BlobAuditingPolicyState)) 353 c.argument('log_analytics_target_state', 354 arg_group=log_analytics_arg_group, 355 options_list=['--log-analytics-target-state', '--lats'], 356 configured_default='sql-server', 357 help='Indicate whether log analytics is a destination for audit records.', 358 arg_type=get_enum_type(BlobAuditingPolicyState)) 359 c.argument('log_analytics_workspace_resource_id', 360 arg_group=log_analytics_arg_group, 361 options_list=['--log-analytics-workspace-resource-id', '--lawri'], 362 configured_default='sql-server', 363 help='The workspace ID (resource ID of a Log Analytics workspace) for a Log Analytics workspace ' 364 'to which you would like to send Audit Logs.') 365 c.argument('event_hub_target_state', 366 arg_group=event_hub_arg_group, 367 options_list=['--event-hub-target-state', '--ehts'], 368 configured_default='sql-server', 369 help='Indicate whether event hub is a destination for audit records.', 370 arg_type=get_enum_type(BlobAuditingPolicyState)) 371 c.argument('event_hub_authorization_rule_id', 372 arg_group=event_hub_arg_group, 373 options_list=['--event-hub-authorization-rule-id', '--ehari'], 374 configured_default='sql-server', 375 help='The resource Id for the event hub authorization rule.') 376 c.argument('event_hub', 377 arg_group=event_hub_arg_group, 378 options_list=['--event-hub', '--eh'], 379 configured_default='sql-server', 380 help='The name of the event hub. If none is specified ' 381 'when providing event_hub_authorization_rule_id, the default event hub will be selected.' 382 ) 383 384 with self.argument_context('synapse sql audit-policy update') as c: 385 c.argument('blob_auditing_policy_name', options_list=['--blob-auditing-policy-name', '-b'], 386 help='Name of the blob auditing policy name.') 387 c.argument('queue_delay_milliseconds', type=int, 388 options_list=['--queue-delay-time', '--queue-delay-milliseconds'], 389 help='The amount of time in milliseconds that can elapse before audit actions are forced to be processed') 390 391 c.argument('storage_account', 392 options_list=['--storage-account'], 393 arg_group=storage_arg_group, 394 help='Name of the storage account.') 395 396 c.argument('storage_account_access_key', 397 options_list=['--storage-key'], 398 arg_group=storage_arg_group, 399 help='Access key for the storage account.') 400 401 c.argument('storage_endpoint', 402 arg_group=storage_arg_group, 403 help='The storage account endpoint.') 404 _configure_security_policy_storage_params(c) 405 406 policy_arg_group = 'Policy' 407 408 c.argument('state', 409 arg_group=policy_arg_group, 410 help='Auditing policy state', 411 arg_type=get_enum_type(BlobAuditingPolicyState)) 412 413 c.argument('audit_actions_and_groups', 414 options_list=['--actions'], 415 arg_group=policy_arg_group, 416 help='List of actions and action groups to audit.', 417 nargs='+') 418 419 c.argument('retention_days', 420 arg_group=policy_arg_group, 421 help='The number of days to retain audit logs.') 422 423 c.argument('blob_storage_target_state', 424 arg_group=storage_arg_group, 425 options_list=['--blob-storage-target-state', '--bsts'], 426 configured_default='sql-server', 427 help='Indicate whether blob storage is a destination for audit records.', 428 arg_type=get_enum_type(BlobAuditingPolicyState)) 429 430 c.argument('log_analytics_target_state', 431 arg_group=log_analytics_arg_group, 432 options_list=['--log-analytics-target-state', '--lats'], 433 configured_default='sql-server', 434 help='Indicate whether log analytics is a destination for audit records.', 435 arg_type=get_enum_type(BlobAuditingPolicyState)) 436 437 c.argument('log_analytics_workspace_resource_id', 438 arg_group=log_analytics_arg_group, 439 options_list=['--log-analytics-workspace-resource-id', '--lawri'], 440 configured_default='sql-server', 441 help='The workspace ID (resource ID of a Log Analytics workspace) for a Log Analytics workspace ' 442 'to which you would like to send Audit Logs.') 443 444 c.argument('event_hub_target_state', 445 arg_group=event_hub_arg_group, 446 options_list=['--event-hub-target-state', '--ehts'], 447 configured_default='sql-server', 448 help='Indicate whether event hub is a destination for audit records.', 449 arg_type=get_enum_type(BlobAuditingPolicyState)) 450 451 c.argument('event_hub_authorization_rule_id', 452 arg_group=event_hub_arg_group, 453 options_list=['--event-hub-authorization-rule-id', '--ehari'], 454 configured_default='sql-server', 455 help='The resource Id for the event hub authorization rule.') 456 457 c.argument('event_hub', 458 arg_group=event_hub_arg_group, 459 options_list=['--event-hub', '--eh'], 460 configured_default='sql-server', 461 help='The name of the event hub. If none is specified ' 462 'when providing event_hub_authorization_rule_id, the default event hub will be selected.' 463 ) 464 465 with self.argument_context('synapse sql audit-policy') as c: 466 c.argument('blob_auditing_policy_name', options_list=['--blob-auditing-policy-name', '-b'], 467 help='Name of the blob auditing policy name.') 468 c.argument('workspace_name', help='The workspace name.') 469 470 with self.argument_context('synapse sql ad-admin') as c: 471 c.argument('workspace_name', help='The workspace name.') 472 for scope in ['create', 'update']: 473 with self.argument_context('synapse sql ad-admin ' + scope) as c: 474 c.argument('login_name', options_list=['--display-name', '-u'], 475 help='Display name of the Azure AD administrator user or group.') 476 c.argument('object_id', options_list=['--object-id', '-i'], 477 help='The unique ID of the Azure AD administrator.') 478 479 # synapse workspace firewall-rule 480 with self.argument_context('synapse workspace firewall-rule') as c: 481 c.argument('workspace_name', id_part='name', help='The workspace name.') 482 483 with self.argument_context('synapse workspace firewall-rule list') as c: 484 c.argument('workspace_name', id_part=None, help='The workspace name.') 485 486 for scope in ['show', 'create', 'update', 'delete']: 487 with self.argument_context('synapse workspace firewall-rule ' + scope) as c: 488 c.argument('rule_name', arg_type=name_type, id_part='child_name_1', help='The IP firewall rule name') 489 490 for scope in ['create', 'update']: 491 with self.argument_context('synapse workspace firewall-rule ' + scope) as c: 492 c.argument('start_ip_address', help='The start IP address of the firewall rule. Must be IPv4 format.') 493 c.argument('end_ip_address', help='The end IP address of the firewall rule. Must be IPv4 format. ' 494 'Must be greater than or equal to startIpAddress.') 495 496 # synapse workspace key 497 with self.argument_context('synapse workspace key') as c: 498 c.argument('workspace_name', id_part='name', help='The workspace name.') 499 500 with self.argument_context('synapse workspace key list') as c: 501 c.argument('workspace_name', id_part=None, help='The workspace name.') 502 503 for scope in ['show', 'create', 'delete']: 504 with self.argument_context('synapse workspace key ' + scope) as c: 505 c.argument('key_name', arg_type=name_type, id_part='child_name_1', help='The workspace customer-managed key display name. All existing keys can be found using /"az synapse workspace key list/" cmdlet.') 506 507 with self.argument_context('synapse workspace key create') as c: 508 c.argument('key_identifier', help='The Key Vault Url of the workspace encryption key. should be in the format of: https://{keyvaultname}.vault.azure.net/keys/{keyname}.') 509 510 # synapse workspace managed-identity 511 with self.argument_context('synapse workspace managed-identity') as c: 512 c.argument('workspace_name', id_part='name', help='The workspace name.') 513 514 for scope in ['grant-sql-access', 'revoke-sql-access', ' show-sql-access']: 515 with self.argument_context('synapse workspace managed-identity ' + scope) as c: 516 c.argument('workspace_name', id_part='name', help='The workspace name.') 517 518 # synapse spark job 519 for scope in ['job', 'session', 'statement']: 520 with self.argument_context('synapse spark ' + scope) as c: 521 c.argument('workspace_name', help='The name of the workspace.') 522 c.argument('spark_pool_name', help='The name of the Spark pool.') 523 524 for scope in ['synapse spark job', 'synapse spark session']: 525 with self.argument_context(scope + ' list') as c: 526 c.argument('from_index', help='Optional parameter specifying which index the list should begin from.') 527 c.argument('size', 528 help='The size of the returned list.By default it is 20 and that is the maximum.') 529 530 with self.argument_context('synapse spark job submit') as c: 531 c.argument('main_definition_file', help='The main file used for the job.') 532 c.argument('main_class_name', 533 help='The fully-qualified identifier or the main class that is in the main definition file.') 534 c.argument('command_line_arguments', options_list=['--arguments'], type=split, nargs='+', 535 help='Optional arguments to the job (Note: please use storage URIs for file arguments).') 536 c.argument('archives', nargs='+', help='The array of archives.') 537 c.argument('job_name', arg_type=name_type, help='The Spark job name.') 538 c.argument('reference_files', nargs='+', 539 help='Additional files used for reference in the main definition file.') 540 c.argument('configuration', type=shell_safe_json_parse, help='The configuration of Spark job.') 541 c.argument('executors', help='The number of executors.') 542 c.argument('executor_size', arg_type=get_enum_type(['Small', 'Medium', 'Large']), help='The executor size') 543 c.argument('tags', arg_type=tags_type) 544 c.argument('language', arg_type=get_enum_type(SparkBatchLanguage, default=SparkBatchLanguage.Scala), 545 help='The Spark job language.') 546 547 for scope in ['show', 'cancel']: 548 with self.argument_context('synapse spark job ' + scope) as c: 549 c.argument('job_id', options_list=['--livy-id'], arg_group='Spark job', 550 help='The id of the Spark job.') 551 552 with self.argument_context('synapse spark session create') as c: 553 c.argument('job_name', arg_type=name_type, help='The Spark session name.') 554 c.argument('reference_files', nargs='+', 555 help='Additional files used for reference in the main definition file.') 556 c.argument('configuration', type=get_json_object, help='The configuration of Spark session.') 557 c.argument('executors', help='The number of executors.') 558 c.argument('executor_size', arg_type=get_enum_type(['Small', 'Medium', 'Large']), help='The executor size') 559 c.argument('tags', arg_type=tags_type) 560 561 for scope in ['show', 'cancel', 'reset-timeout']: 562 with self.argument_context('synapse spark session ' + scope) as c: 563 c.argument('session_id', options_list=['--livy-id'], arg_group='Spark Session', 564 help='The id of the Spark session job.') 565 566 with self.argument_context('synapse spark statement') as c: 567 c.argument('session_id', help='The id of Spark session.') 568 569 for scope in ['show', 'cancel']: 570 with self.argument_context('synapse spark statement ' + scope) as c: 571 c.argument('statement_id', options_list=['--livy-id'], arg_group="Spark statement", 572 help='The id of the statement.') 573 574 with self.argument_context('synapse spark statement invoke') as c: 575 c.argument('code', completer=FilesCompleter(), 576 help='The code of Spark statement. This is either the code contents or use `@<file path>` to load the content from a file') 577 c.argument('language', arg_type=get_enum_type(SparkStatementLanguage), validator=validate_statement_language, 578 help='The language of Spark statement.') 579 580 # synapse workspace access-control 581 for scope in ['create', 'list']: 582 with self.argument_context('synapse role assignment ' + scope) as c: 583 c.argument('workspace_name', arg_type=workspace_name_arg_type) 584 c.argument('role', arg_type=role_arg_type) 585 c.argument('assignee', arg_type=assignee_arg_type) 586 c.argument('assignee_object_id', arg_type=assignee_object_id_arg_type) 587 c.argument('scope', help='A scope defines the resources or artifacts that the access applies to. Synapse supports hierarchical scopes. ' 588 'Permissions granted at a higher-level scope are inherited by objects at a lower level. ' 589 'In Synapse RBAC, the top-level scope is a workspace. ' 590 'Assigning a role with workspace scope grants permissions to all applicable objects in the workspace.') 591 c.argument('item', help='Item granted access in the workspace. Using with --item-type to combine the scope of assignment') 592 c.argument('item_type', arg_type=get_enum_type(ItemType), help='Item type granted access in the workspace. Using with --item to combine the scope of assignment.') 593 594 with self.argument_context('synapse role assignment create') as c: 595 c.argument('assignee_principal_type', options_list=['--assignee-principal-type', '--assignee-type'], arg_type=get_enum_type(PrincipalType), 596 help='use with --assignee-object-id to avoid errors caused by propagation latency in AAD Graph') 597 c.argument('assignment_id', help='Custom role assignment id in guid format, if not specified, assignment id will be randomly generated.') 598 599 with self.argument_context('synapse role assignment show') as c: 600 c.argument('workspace_name', arg_type=workspace_name_arg_type) 601 c.argument('role_assignment_id', options_list=['--id'], 602 help='Id of the role that is assigned to the principal.') 603 604 with self.argument_context('synapse role assignment delete') as c: 605 c.argument('workspace_name', arg_type=workspace_name_arg_type) 606 c.argument('role', arg_type=role_arg_type) 607 c.argument('assignee', arg_type=assignee_arg_type) 608 c.argument('assignee_object_id', arg_type=assignee_object_id_arg_type) 609 c.argument('scope', help='A scope defines the resources or artifacts that the access applies to. Synapse supports hierarchical scopes. ' 610 'Permissions granted at a higher-level scope are inherited by objects at a lower level. ' 611 'In Synapse RBAC, the top-level scope is a workspace. ' 612 'Using az role assignment with filter condition before executing delete operation ' 613 'to be clearly aware of which assignments will be deleted.') 614 c.argument('ids', nargs='+', 615 help='space-separated role assignment ids. You should not provide --role or --assignee when --ids is provided.') 616 c.argument('item', help='Item granted access in the workspace. Using with --item-type to combine the scope of assignment.' 617 'Using az role assignment with filter condition before executing delete operation ' 618 'to be clearly aware of which assignments will be deleted.') 619 c.argument('item_type', arg_type=get_enum_type(ItemType), help='Item type granted access in the workspace. Using with --item to combine the scope of assignment.' 620 'Using az role assignment with filter condition before executing delete operation ' 621 'to be clearly aware of which assignments will be deleted.') 622 623 with self.argument_context('synapse role definition show') as c: 624 c.argument('workspace_name', arg_type=workspace_name_arg_type) 625 c.argument('role', arg_type=role_arg_type) 626 627 with self.argument_context('synapse role definition list') as c: 628 c.argument('workspace_name', arg_type=workspace_name_arg_type) 629 c.argument('is_built_in', arg_type=get_three_state_flag(), help='Is a Synapse Built-In Role or not.') 630 631 with self.argument_context('synapse role scope list') as c: 632 c.argument('workspace_name', arg_type=workspace_name_arg_type) 633 634 # synapse artifacts linked-service 635 for scope in ['create', 'update', 'set']: 636 with self.argument_context('synapse linked-service ' + scope) as c: 637 c.argument('workspace_name', arg_type=workspace_name_arg_type) 638 c.argument('linked_service_name', arg_type=name_type, help='The linked service name.') 639 c.argument('definition_file', arg_type=definition_file_arg_type) 640 641 with self.argument_context('synapse linked-service list') as c: 642 c.argument('workspace_name', arg_type=workspace_name_arg_type) 643 644 with self.argument_context('synapse linked-service show') as c: 645 c.argument('workspace_name', arg_type=workspace_name_arg_type) 646 c.argument('linked_service_name', arg_type=name_type, help='The linked service name.') 647 648 with self.argument_context('synapse linked-service delete') as c: 649 c.argument('workspace_name', arg_type=workspace_name_arg_type) 650 c.argument('linked_service_name', arg_type=name_type, help='The linked service name.') 651 652 # synapse artifacts dataset 653 for scope in ['create', 'update', 'set']: 654 with self.argument_context('synapse dataset ' + scope) as c: 655 c.argument('workspace_name', arg_type=workspace_name_arg_type) 656 c.argument('dataset_name', arg_type=name_type, help='The dataset name.') 657 c.argument('definition_file', arg_type=definition_file_arg_type) 658 659 with self.argument_context('synapse dataset list') as c: 660 c.argument('workspace_name', arg_type=workspace_name_arg_type) 661 662 with self.argument_context('synapse dataset show') as c: 663 c.argument('workspace_name', arg_type=workspace_name_arg_type) 664 c.argument('dataset_name', arg_type=name_type, help='The dataset name.') 665 666 with self.argument_context('synapse dataset delete') as c: 667 c.argument('workspace_name', arg_type=workspace_name_arg_type) 668 c.argument('dataset_name', arg_type=name_type, help='The dataset name.') 669 670 # synapse artifacts pipeline 671 for scope in ['create', 'update', 'set']: 672 with self.argument_context('synapse pipeline ' + scope) as c: 673 c.argument('workspace_name', arg_type=workspace_name_arg_type) 674 c.argument('pipeline_name', arg_type=name_type, help='The pipeline name.') 675 c.argument('definition_file', arg_type=definition_file_arg_type) 676 677 with self.argument_context('synapse pipeline list') as c: 678 c.argument('workspace_name', arg_type=workspace_name_arg_type) 679 680 with self.argument_context('synapse pipeline show') as c: 681 c.argument('workspace_name', arg_type=workspace_name_arg_type) 682 c.argument('pipeline_name', arg_type=name_type, help='The pipeline name.') 683 684 with self.argument_context('synapse pipeline delete') as c: 685 c.argument('workspace_name', arg_type=workspace_name_arg_type) 686 c.argument('pipeline_name', arg_type=name_type, help='The pipeline name.') 687 688 with self.argument_context('synapse pipeline create-run') as c: 689 c.argument('workspace_name', arg_type=workspace_name_arg_type) 690 c.argument('pipeline_name', arg_type=name_type, help='The pipeline name.') 691 c.argument('reference_pipeline_run_id', options_list=['--reference-pipeline-run-id', '--run-id'], 692 help='The pipeline run ID for rerun. If run ID is specified, the parameters of the specified run will be used to create a new run.') 693 c.argument('is_recovery', arg_type=get_three_state_flag(), 694 help='Recovery mode flag. If recovery mode is set to true, the specified referenced pipeline run and the new run will be grouped under the same groupId.') 695 c.argument('start_activity_name', 696 help='In recovery mode, the rerun will start from this activity. If not specified, all activities will run.') 697 c.argument('parameters', completer=FilesCompleter(), type=shell_safe_json_parse, 698 help='Parameters for pipeline run. Can be supplied from a JSON file using the `@{path}` syntax or a JSON string.') 699 700 # synapse artifacts pipeline run 701 with self.argument_context('synapse pipeline-run query-by-workspace') as c: 702 c.argument('workspace_name', arg_type=workspace_name_arg_type) 703 c.argument('continuation_token', 704 help='The continuation token for getting the next page of results. Null for first page.') 705 c.argument('last_updated_after', 706 help='The time at or after which the run event was updated in \'ISO 8601\' format.') 707 c.argument('last_updated_before', 708 help='The time at or before which the run event was updated in \'ISO 8601\' format.') 709 c.argument('filters', action=AddFilters, nargs='*', help='List of filters.') 710 c.argument('order_by', action=AddOrderBy, nargs='*', help='List of OrderBy option.') 711 712 with self.argument_context('synapse pipeline-run show') as c: 713 c.argument('workspace_name', arg_type=workspace_name_arg_type) 714 c.argument('run_id', help='The pipeline run identifier.') 715 716 with self.argument_context('synapse pipeline-run cancel') as c: 717 c.argument('workspace_name', arg_type=workspace_name_arg_type) 718 c.argument('run_id', help='The pipeline run identifier.') 719 c.argument('is_recursive', arg_type=get_three_state_flag(), 720 help='If true, cancel all the Child pipelines that are triggered by the current pipeline.') 721 722 with self.argument_context('synapse activity-run query-by-pipeline-run') as c: 723 c.argument('workspace_name', arg_type=workspace_name_arg_type) 724 c.argument('pipeline_name', arg_type=name_type, help='The pipeline name.') 725 c.argument('run_id', help='The pipeline run identifier.') 726 c.argument('continuation_token', 727 help='The continuation token for getting the next page of results. Null for first page.') 728 c.argument('last_updated_after', 729 help='The time at or after which the run event was updated in \'ISO 8601\' format.') 730 c.argument('last_updated_before', 731 help='The time at or before which the run event was updated in \'ISO 8601\' format.') 732 c.argument('filters', action=AddFilters, nargs='*', help='List of filters.') 733 c.argument('order_by', action=AddOrderBy, nargs='*', help='List of OrderBy option.') 734 735 # synapse artifacts trigger 736 for scope in ['create', 'update', 'set']: 737 with self.argument_context('synapse trigger ' + scope) as c: 738 c.argument('workspace_name', arg_type=workspace_name_arg_type) 739 c.argument('trigger_name', arg_type=name_type, help='The trigger name.') 740 c.argument('definition_file', arg_type=definition_file_arg_type) 741 742 with self.argument_context('synapse trigger list') as c: 743 c.argument('workspace_name', arg_type=workspace_name_arg_type) 744 745 with self.argument_context('synapse trigger show') as c: 746 c.argument('workspace_name', arg_type=workspace_name_arg_type) 747 c.argument('trigger_name', arg_type=name_type, help='The trigger name.') 748 749 with self.argument_context('synapse trigger delete') as c: 750 c.argument('workspace_name', arg_type=workspace_name_arg_type) 751 c.argument('trigger_name', arg_type=name_type, help='The trigger name.') 752 753 with self.argument_context('synapse trigger subscribe-to-event') as c: 754 c.argument('workspace_name', arg_type=workspace_name_arg_type) 755 c.argument('trigger_name', arg_type=name_type, help='The trigger name.') 756 757 with self.argument_context('synapse trigger get-event-subscription-status') as c: 758 c.argument('workspace_name', arg_type=workspace_name_arg_type) 759 c.argument('trigger_name', arg_type=name_type, help='The trigger name.') 760 761 with self.argument_context('synapse trigger unsubscribe-from-event') as c: 762 c.argument('workspace_name', arg_type=workspace_name_arg_type) 763 c.argument('trigger_name', arg_type=name_type, help='The trigger name.') 764 765 with self.argument_context('synapse trigger start') as c: 766 c.argument('workspace_name', arg_type=workspace_name_arg_type) 767 c.argument('trigger_name', arg_type=name_type, help='The trigger name.') 768 769 with self.argument_context('synapse trigger stop') as c: 770 c.argument('workspace_name', arg_type=workspace_name_arg_type) 771 c.argument('trigger_name', arg_type=name_type, help='The trigger name.') 772 773 with self.argument_context('synapse trigger wait') as c: 774 c.argument('workspace_name', arg_type=workspace_name_arg_type) 775 c.argument('trigger_name', arg_type=name_type, help='The trigger name.') 776 777 # synapse artifacts trigger run 778 with self.argument_context('synapse trigger-run rerun') as c: 779 c.argument('workspace_name', arg_type=workspace_name_arg_type) 780 c.argument('trigger_name', arg_type=name_type, help='The trigger name.') 781 c.argument('run_id', help='The trigger run identifier.') 782 783 with self.argument_context('synapse trigger-run cancel') as c: 784 c.argument('workspace_name', arg_type=workspace_name_arg_type) 785 c.argument('trigger_name', arg_type=name_type, help='The trigger name.') 786 c.argument('run_id', help='The trigger run identifier.') 787 788 with self.argument_context('synapse trigger-run query-by-workspace') as c: 789 c.argument('workspace_name', arg_type=workspace_name_arg_type) 790 c.argument('continuation_token', 791 help='The continuation token for getting the next page of results. Null for first page.') 792 c.argument('last_updated_after', 793 help='The time at or after which the run event was updated in \'ISO 8601\' format.') 794 c.argument('last_updated_before', 795 help='The time at or before which the run event was updated in \'ISO 8601\' format.') 796 c.argument('filters', action=AddFilters, nargs='*', help='List of filters.') 797 c.argument('order_by', action=AddOrderBy, nargs='*', help='List of OrderBy option.') 798 799 # synapse artifacts data flow 800 for scope in ['create', 'set']: 801 with self.argument_context('synapse data-flow ' + scope) as c: 802 c.argument('workspace_name', arg_type=workspace_name_arg_type) 803 c.argument('data_flow_name', arg_type=name_type, help='The data flow name.') 804 c.argument('definition_file', arg_type=definition_file_arg_type) 805 806 with self.argument_context('synapse data-flow list') as c: 807 c.argument('workspace_name', arg_type=workspace_name_arg_type) 808 809 with self.argument_context('synapse data-flow show') as c: 810 c.argument('workspace_name', arg_type=workspace_name_arg_type) 811 c.argument('data_flow_name', arg_type=name_type, help='The data flow name.') 812 813 with self.argument_context('synapse data-flow delete') as c: 814 c.argument('workspace_name', arg_type=workspace_name_arg_type) 815 c.argument('data_flow_name', arg_type=name_type, help='The data flow name.') 816 817 # synapse artifacts notebook 818 for scope in ['create', 'set', 'import']: 819 with self.argument_context('synapse notebook ' + scope) as c: 820 c.argument('workspace_name', arg_type=workspace_name_arg_type) 821 c.argument('notebook_name', arg_type=name_type, help='The notebook name.') 822 c.argument('definition_file', arg_type=definition_file_arg_type) 823 c.argument('spark_pool_name', help='The name of the Spark pool.') 824 c.argument('executor_size', arg_type=get_enum_type(['Small', 'Medium', 'Large']), 825 help='Number of core and memory to be used for executors allocated in the specified Spark pool for the job.') 826 c.argument('executor_count', 827 help='Number of executors to be allocated in the specified Spark pool for the job.') 828 829 with self.argument_context('synapse notebook list') as c: 830 c.argument('workspace_name', arg_type=workspace_name_arg_type) 831 832 with self.argument_context('synapse notebook show') as c: 833 c.argument('workspace_name', arg_type=workspace_name_arg_type) 834 c.argument('notebook_name', arg_type=name_type, help='The notebook name.') 835 836 with self.argument_context('synapse notebook export') as c: 837 c.argument('workspace_name', arg_type=workspace_name_arg_type) 838 c.argument('output_folder', help='The folder where the notebook should be placed.') 839 c.argument('notebook_name', arg_type=name_type, help='The notebook name.') 840 841 with self.argument_context('synapse notebook delete') as c: 842 c.argument('workspace_name', arg_type=workspace_name_arg_type) 843 c.argument('notebook_name', arg_type=name_type, help='The notebook name.') 844 845 # synapse artifacts library 846 with self.argument_context('synapse workspace-package') as c: 847 c.argument('workspace_name', arg_type=workspace_name_arg_type) 848 c.ignore('progress_callback') 849 850 for scope in ['show', 'delete']: 851 with self.argument_context('synapse workspace-package ' + scope) as c: 852 c.argument('package_name', arg_type=name_type, options_list=['--package-name', '--package', '--name', '-n'], help='The workspace package name.') 853 854 with self.argument_context('synapse workspace-package upload') as c: 855 c.argument('package', options_list=('--package', '--file', '-f'), type=file_type, completer=FilesCompleter(), 856 help='Specifies a local file path for a file to upload as workspace package.') 857 c.extra('no_progress', progress_type) 858 859 with self.argument_context('synapse workspace-package upload-batch') as c: 860 c.argument('source', options_list=('--source', '-s'), help='The directory where the files to be uploaded are located.') 861 c.extra('no_progress', progress_type) 862 863 # synapse integration runtime 864 with self.argument_context('synapse integration-runtime') as c: 865 c.argument('workspace_name', arg_type=workspace_name_arg_type, id_part='name') 866 867 for scope in ['list', 'list-auth-key', 'wait']: 868 with self.argument_context('synapse integration-runtime ' + scope) as c: 869 c.argument('workspace_name', arg_type=workspace_name_arg_type, id_part=None) 870 871 for scope in ['list-auth-key', 'wait']: 872 with self.argument_context('synapse integration-runtime ' + scope) as c: 873 c.argument('integration_runtime_name', arg_type=name_type, help='The integration runtime name.', id_part=None) 874 875 for scope in ['show', 'create', 'managed create', 'self-hosted create', 'delete', 'wait', 'update', 'upgrade', 'regenerate-auth-key', 'get-monitoring-data', 'sync-credentials', 'get-connection-info', 'get-status', 'start', 'stop']: 876 with self.argument_context('synapse integration-runtime ' + scope) as c: 877 c.argument('integration_runtime_name', arg_type=name_type, help='The integration runtime name.', id_part='child_name_1') 878 879 with self.argument_context('synapse integration-runtime create') as c: 880 c.argument('integration_runtime_type', options_list=['--type'], arg_type=get_enum_type(['Managed', 'SelfHosted']), help='The integration runtime type.') 881 c.argument('description', help='The integration runtime description.') 882 c.argument('if_match', help='ETag of the integration runtime entity. Should only be specified for update, for ' 883 'which it should match existing entity or can be * for unconditional update.') 884 # Managed 885 c.argument('location', arg_group='Managed', help='The integration runtime location.') 886 c.argument('compute_type', arg_group='Managed', arg_type=get_enum_type(['General', 'MemoryOptimized', 'ComputeOptimized']), 887 help='Compute type of the data flow cluster which will execute data flow job.') 888 c.argument('core_count', arg_group='Managed', help='Core count of the data flow cluster which will execute data flow job.') 889 c.argument('time_to_live', arg_group='Managed', help='Time to live (in minutes) setting of the data flow cluster which will execute data flow job.') 890 891 with self.argument_context('synapse integration-runtime managed create') as c: 892 c.argument('description', help='The integration runtime description.') 893 c.argument('if_match', help='ETag of the integration runtime entity. Should only be specified for update, for ' 894 'which it should match existing entity or can be * for unconditional update.') 895 c.argument('location', help='The integration runtime location.') 896 c.argument('compute_type', arg_type=get_enum_type(['General', 'MemoryOptimized', 'ComputeOptimized']), 897 help='Compute type of the data flow cluster which will execute data flow job.') 898 c.argument('core_count', help='Core count of the data flow cluster which will execute data flow job.') 899 c.argument('time_to_live', help='Time to live (in minutes) setting of the data flow cluster which will execute data flow job.') 900 901 with self.argument_context('synapse integration-runtime self-hosted create') as c: 902 c.argument('description', help='The integration runtime description.') 903 c.argument('if_match', help='ETag of the integration runtime entity. Should only be specified for update, for ' 904 'which it should match existing entity or can be * for unconditional update.') 905 906 with self.argument_context('synapse integration-runtime update') as c: 907 c.argument('auto_update', arg_type=get_enum_type(['On', 'Off']), help='Enable or disable the self-hosted integration runtime auto-update.') 908 c.argument('update_delay_offset', help='The time of the day for the self-hosted integration runtime auto-update.') 909 910 with self.argument_context('synapse integration-runtime regenerate-auth-key') as c: 911 c.argument('key_name', arg_type=get_enum_type(['authKey1', 'authKey2']), help='The name of the authentication key to regenerate.') 912 913 with self.argument_context('synapse integration-runtime-node') as c: 914 c.argument('workspace_name', arg_type=workspace_name_arg_type, id_part='name') 915 c.argument('integration_runtime_name', arg_type=name_type, help='The integration runtime name.', id_part='child_name_1') 916 917 for scope in ['show', 'update', 'delete', 'get-ip-address']: 918 with self.argument_context('synapse integration-runtime-node ' + scope) as c: 919 c.argument('node_name', help='The integration runtime node name.') 920 921 with self.argument_context('synapse integration-runtime-node update') as c: 922 c.argument('concurrent_jobs_limit', options_list=['--concurrent-jobs'], help='The number of concurrent jobs permitted to ' 923 'run on the integration runtime node. Values between 1 and maxConcurrentJobs are allowed.') 924 c.argument('auto_update', arg_type=get_enum_type(['On', 'Off']), 925 help='Enable or disable the self-hosted integration runtime auto-update.') 926 c.argument('update_delay_offset', 927 help='The time of the day for the self-hosted integration runtime auto-update.') 928 929 # synapse managed private endpoints 930 for scope in ['show', 'create', 'delete']: 931 with self.argument_context('synapse managed-private-endpoints ' + scope) as c: 932 c.argument('workspace_name', arg_type=workspace_name_arg_type, id_part='name') 933 c.argument('managed_private_endpoint_name', options_list=['--pe-name'], help='The managed private endpoint name.') 934 935 with self.argument_context('synapse managed-private-endpoints list') as c: 936 c.argument('workspace_name', arg_type=workspace_name_arg_type) 937 938 with self.argument_context('synapse managed-private-endpoints create') as c: 939 c.argument('private_Link_Resource_Id', options_list=['--resource-id'], help='The ARM resource ID of the resource to which the managed private endpoint is created. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}') 940 c.argument('group_Id', help='The groupId to which the managed private endpoint is created') 941 942 # synapse artifacts spark job definition 943 with self.argument_context('synapse spark-job-definition list') as c: 944 c.argument('workspace_name', arg_type=workspace_name_arg_type) 945 946 for scope in ['show', 'wait', 'delete']: 947 with self.argument_context('synapse spark-job-definition ' + scope) as c: 948 c.argument('workspace_name', arg_type=workspace_name_arg_type) 949 c.argument('spark_job_definition_name', options_list=['--name', '-n'], help='The spark job definition name') 950 951 for scope in ['create', 'update']: 952 with self.argument_context('synapse spark-job-definition ' + scope) as c: 953 c.argument('workspace_name', arg_type=workspace_name_arg_type) 954 c.argument('spark_job_definition_name', options_list=['--name', '-n'], help='The spark job definition name') 955 c.argument('definition_file', arg_type=definition_file_arg_type) 956