{Network} az network dns record-set: Migrate commands to codegen v2#26036
Merged
{Network} az network dns record-set: Migrate commands to codegen v2#26036
az network dns record-set: Migrate commands to codegen v2#26036Conversation
️✔️acr
️✔️acs
️✔️advisor
️✔️ams
️✔️apim
️✔️appconfig
️✔️appservice
️✔️aro
️✔️backup
️✔️batch
️✔️batchai
️✔️billing
️✔️botservice
️✔️cdn
️✔️cloud
️✔️cognitiveservices
️✔️config
️✔️configure
️✔️consumption
️✔️container
️✔️core
️✔️cosmosdb
️✔️databoxedge
️✔️dla
️✔️dls
️✔️dms
️✔️eventgrid
️✔️eventhubs
️✔️feedback
️✔️find
️✔️hdinsight
️✔️identity
️✔️iot
️✔️keyvault
️✔️kusto
️✔️lab
️✔️managedservices
️✔️maps
️✔️marketplaceordering
️✔️monitor
️✔️netappfiles
️✔️network
️✔️policyinsights
️✔️privatedns
️✔️profile
️✔️rdbms
️✔️redis
️✔️relay
️✔️resource
️✔️role
️✔️search
️✔️security
️✔️servicebus
️✔️serviceconnector
️✔️servicefabric
️✔️signalr
️✔️sql
️✔️sqlvm
️✔️storage
️✔️synapse
️✔️telemetry
️✔️util
️✔️vm
|
Collaborator
|
Network |
kairu-ms
reviewed
Apr 4, 2023
kairu-ms
reviewed
Apr 4, 2023
kairu-ms
reviewed
Apr 7, 2023
kairu-ms
reviewed
Apr 7, 2023
| record_set = dict() | ||
| record_set["ttl"] = ret.get("TTL", None) | ||
| record_set[record_snake] = ret.get(record_camel, None) | ||
| record_set = _convert_to_snake_case(record_set) |
Contributor
There was a problem hiding this comment.
Why need convert to snack case?
Contributor
There was a problem hiding this comment.
I think AAZCommands can auto parse camel case argument key automatically.
azure-cli/src/azure-cli-core/azure/cli/core/aaz/_field_type.py
Lines 180 to 183 in efc8487
kairu-ms
reviewed
Apr 10, 2023
Comment on lines
+2423
to
+2434
| def _convert_to_snake_case(element): | ||
| if isinstance(element, dict): | ||
| ret = dict() | ||
| for k, v in element.items(): | ||
| ret[_to_snake(k)] = _convert_to_snake_case(v) | ||
|
|
||
| return ret | ||
|
|
||
| if isinstance(element, list): | ||
| return [_convert_to_snake_case(i) for i in element] | ||
|
|
||
| return element |
Contributor
There was a problem hiding this comment.
What if the element contains property like tags? This will change the key from camel case to snack case.
Member
Author
There was a problem hiding this comment.
There is no properties like that, all properties are used for checking:
azure-cli/src/azure-cli/azure/cli/command_modules/network/custom.py
Lines 2985 to 3045 in 478f69c
kairu-ms
approved these changes
Apr 10, 2023
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.
Related command
Description
Total: 47 commands
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 featureThis 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.
I adhere to the Error Handling Guidelines.