-
Notifications
You must be signed in to change notification settings - Fork 3.4k
[AppConfig] az appconfig create\update\network-security-perimeter-configuration: Add NSP support
#33301
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
base: dev
Are you sure you want to change the base?
[AppConfig] az appconfig create\update\network-security-perimeter-configuration: Add NSP support
#33301
Changes from all commits
ed60f1e
7ef0550
3ef7251
f2f8848
047afb0
c949e54
d905e87
40681b4
176166c
083570e
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 | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,41 @@ | ||||||
| # -------------------------------------------------------------------------------------------- | ||||||
| # 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 | ||||||
|
|
||||||
| from azure.core.exceptions import ResourceNotFoundError | ||||||
|
|
||||||
| from ._utils import resolve_store_metadata | ||||||
|
|
||||||
|
|
||||||
| def list_nsp_configurations(cmd, client, store_name, resource_group_name=None): | ||||||
| if resource_group_name is None: | ||||||
| resource_group_name, _ = resolve_store_metadata(cmd, store_name) | ||||||
| return client.list_by_configuration_store(resource_group_name=resource_group_name, config_store_name=store_name) | ||||||
|
|
||||||
|
|
||||||
| def show_nsp_configuration(cmd, client, store_name, name, resource_group_name=None): | ||||||
| if resource_group_name is None: | ||||||
| resource_group_name, _ = resolve_store_metadata(cmd, store_name) | ||||||
| try: | ||||||
| return client.get( | ||||||
| resource_group_name=resource_group_name, | ||||||
| config_store_name=store_name, | ||||||
| network_security_perimeter_configuration_name=name | ||||||
| ) | ||||||
| except ResourceNotFoundError: | ||||||
|
Member
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. I notice that when we do a show for a configuration store, we let this error go unhandled (link). So is error handling missing there, or is this unnecessary? |
||||||
| raise ResourceNotFoundError( | ||||||
| "The network security perimeter configuration '{}' for App Configuration '{}' not found.".format( | ||||||
|
Member
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.
Suggested change
Copilot suggested this, seems to have been missed. |
||||||
| name, store_name)) | ||||||
|
|
||||||
|
|
||||||
| def reconcile_nsp_configuration(cmd, client, store_name, name, resource_group_name=None): | ||||||
| if resource_group_name is None: | ||||||
| resource_group_name, _ = resolve_store_metadata(cmd, store_name) | ||||||
| return client.begin_reconcile( | ||||||
| resource_group_name=resource_group_name, | ||||||
| config_store_name=store_name, | ||||||
| network_security_perimeter_configuration_name=name | ||||||
| ) | ||||||
|
ChristineWanjau marked this conversation as resolved.
|
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Every other command seems to have
table_transformerspecified. How come nsp doesn't need it?