-
Notifications
You must be signed in to change notification settings - Fork 3.3k
[Synapse] az synapse: Add for managed private endpoints commands #19117
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
Merged
Merged
Changes from 5 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
931441a
add managed private endpoints
kevinzz6 bf2711d
fix cli style errors
kevinzz6 d2d175c
fix azure linter errors
kevinzz6 b886129
fix cli linter errors
kevinzz6 fe9ceac
fix azdev cli test errors
kevinzz6 97d6014
fix nowait issue
kevinzz6 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -179,6 +179,10 @@ def get_custom_sdk(custom_module, client_factory): | |
| operation_tmpl='azure.synapse.artifacts.operations#NotebookOperations.{}', | ||
| client_factory=None) | ||
|
|
||
| synapse_managed_private_endpoints_sdk = CliCommandType( | ||
| operation_tmpl='azure.synapse.managedprivateendpoints.operations#ManagedPrivateEndpoints.{}', | ||
| client_factory=None) | ||
|
|
||
| # Management Plane Commands --Workspace | ||
| with self.command_group('synapse workspace', command_type=synapse_workspace_sdk, | ||
| custom_command_type=get_custom_sdk('workspace', cf_synapse_client_workspace_factory), | ||
|
|
@@ -478,5 +482,13 @@ def get_custom_sdk(custom_module, client_factory): | |
| g.custom_command('export', 'export_notebook') | ||
| g.custom_command('delete', 'delete_notebook', confirmation=True, supports_no_wait=True) | ||
|
|
||
| # Data Plane Commands --Managed private endpoints operations | ||
| with self.command_group('synapse managed-private-endpoints', synapse_managed_private_endpoints_sdk, | ||
| custom_command_type=get_custom_sdk('managedprivateendpoints', None)) as g: | ||
| g.custom_show_command('show', 'get_Managed_private_endpoints') | ||
| g.custom_command('create', 'create_Managed_private_endpoints', supports_no_wait=True) | ||
| g.custom_command('list', 'list_Managed_private_endpoints') | ||
| g.custom_command('delete', 'delete_Managed_private_endpoints', confirmation=True, supports_no_wait=True) | ||
|
||
|
|
||
| with self.command_group('synapse', is_preview=True): | ||
| pass | ||
36 changes: 36 additions & 0 deletions
36
src/azure-cli/azure/cli/command_modules/synapse/operations/managedprivateendpoints.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| # -------------------------------------------------------------------------------------------- | ||
| # Copyright (c) Microsoft Corporation. All rights reserved. | ||
| # Licensed under the MIT License. See License.txt in the project root for license information. | ||
| # -------------------------------------------------------------------------------------------- | ||
| # pylint: disable=line-too-long, too-many-statements, too-many-locals | ||
| from azure.cli.core.util import sdk_no_wait | ||
| from .._client_factory import cf_synapse_managedprivateendpoints_factory | ||
|
|
||
|
|
||
| def create_Managed_private_endpoints(cmd, workspace_name, managed_private_endpoint_name, private_Link_Resource_Id, group_Id, no_wait=False): | ||
| client = cf_synapse_managedprivateendpoints_factory(cmd.cli_ctx, workspace_name) | ||
| property_files = {} | ||
| property_files['privateLinkResourceId'] = private_Link_Resource_Id | ||
| property_files['groupId'] = group_Id | ||
| properties = property_files | ||
| managed_virtual_network_name = "default" | ||
| return sdk_no_wait(no_wait, client.create, | ||
| managed_private_endpoint_name, managed_virtual_network_name, properties) | ||
|
|
||
|
|
||
| def get_Managed_private_endpoints(cmd, workspace_name, managed_private_endpoint_name): | ||
| client = cf_synapse_managedprivateendpoints_factory(cmd.cli_ctx, workspace_name) | ||
| managed_virtual_network_name = "default" | ||
| return client.get(managed_private_endpoint_name, managed_virtual_network_name) | ||
|
|
||
|
|
||
| def list_Managed_private_endpoints(cmd, workspace_name): | ||
| client = cf_synapse_managedprivateendpoints_factory(cmd.cli_ctx, workspace_name) | ||
| managed_virtual_network_name = "default" | ||
| return client.list(managed_virtual_network_name) | ||
|
|
||
|
|
||
| def delete_Managed_private_endpoints(cmd, workspace_name, managed_private_endpoint_name, no_wait=False): | ||
| client = cf_synapse_managedprivateendpoints_factory(cmd.cli_ctx, workspace_name) | ||
| managed_virtual_network_name = "default" | ||
| return sdk_no_wait(no_wait, client.delete, managed_private_endpoint_name, managed_virtual_network_name) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.