[Network] support generic commands for private link scenario#13225
Merged
mmyyrroonn merged 17 commits intoAzure:devfrom May 11, 2020
Merged
[Network] support generic commands for private link scenario#13225mmyyrroonn merged 17 commits intoAzure:devfrom
mmyyrroonn merged 17 commits intoAzure:devfrom
Conversation
Collaborator
|
add to S169 |
...odules/network/private_link_resource_and_endpoint_connections/resource_providers/__init__.py
Outdated
Show resolved
Hide resolved
mmyyrroonn
commented
May 7, 2020
...odules/network/private_link_resource_and_endpoint_connections/resource_providers/__init__.py
Outdated
Show resolved
Hide resolved
...odules/network/private_link_resource_and_endpoint_connections/resource_providers/__init__.py
Outdated
Show resolved
Hide resolved
...odules/network/private_link_resource_and_endpoint_connections/resource_providers/__init__.py
Outdated
Show resolved
Hide resolved
added 17 commits
May 8, 2020 10:47
a4296df to
a4cc8de
Compare
Contributor
Author
|
/azp run Azure.azure-cli |
|
Azure Pipelines successfully started running 1 pipeline(s). |
jiasli
reviewed
May 8, 2020
Comment on lines
+69
to
+78
| while query_counts: | ||
| time.sleep(RETRY_INTERVAL) | ||
| query_counts -= 1 | ||
| private_endpoint_connection = self.show_private_endpoint_connection(cmd, | ||
| resource_group_name, | ||
| service_name, | ||
| private_endpoint_connection_name) | ||
| if private_endpoint_connection['properties'].get('provisioningState'): | ||
| if private_endpoint_connection['properties']['provisioningState'] == "Succeeded": | ||
| return private_endpoint_connection |
Member
There was a problem hiding this comment.
Maybe we can extract this part and put it into core, so that az rest can also benefit from it by using az rest --wait-async.
Contributor
Author
There was a problem hiding this comment.
the show method is specific to each get rest call. wait command requires user's input to identify the resource. So I think it's not suitable to have a generic way.
Member
There was a problem hiding this comment.
Made a demo:
def send_raw_request_wait(*args, timeout=3600, expected_status_code=None,
body_query=None, expected_body_query_result=None, **kwargs):
RETRY_MAX = 20
RETRY_INTERVAL = 10
query_counts = RETRY_MAX
import time
import jmespath
# src/azure-cli-core/azure/cli/core/commands/arm.py:676
while query_counts:
time.sleep(RETRY_INTERVAL)
query_counts -= 1
response = send_raw_request(*args, **kwargs)
if body_query and jmespath.search(body_query, response) != expected_body_query_result:
continue
if expected_status_code:
raise NotImplementedError()
raise Exception("Max retry count reached.")But we can consider it later. No hurry.
jiasli
approved these changes
May 8, 2020
haroldrandom
approved these changes
May 11, 2020
yungezz
reviewed
May 11, 2020
| - name: Approve a private endpoint connection for a storage account. | ||
| text: az network private-endpoint-connection approve -g MyResourceGroup -n MyPrivateEndpoint --service-name MySA --type Microsoft.Storage/storageAccounts --description "Approved" | ||
| - name: Approve a private endpoint connection for a keyvault. | ||
| text: az network private-endpoint-connection approve -g MyResourceGroup -n MyPrivateEndpoint --service-name MyKV --type Microsoft.Keyvault/vaults --description "Approved" |
Member
There was a problem hiding this comment.
service-name is confusing, would it more clear resource-name?
Contributor
Author
There was a problem hiding this comment.
make senses. Will change in another PR within this release
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
Testing Guide
History Notes
[Component Name 1] BREAKING CHANGE: az command a: Make some customer-facing breaking change.
[Component Name 2] az command b: Add some customer-facing feature.
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.